Michael Woerister | a36e537 | 2013-08-15 10:23:54 | [diff] [blame] | 1 | // Copyright 2013 The Rust Project Developers. See the COPYRIGHT |
| 2 | // file at the top-level directory of this distribution and at |
| 3 | // http://rust-lang.org/COPYRIGHT. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
Young-il Choi | ca55317 | 2013-11-09 07:16:44 | [diff] [blame] | 11 | // xfail-android: FIXME(#10381) |
sh8281.kim | 4e54828 | 2013-11-04 06:53:01 | [diff] [blame] | 12 | |
Alex Crichton | 071ee96 | 2014-02-07 03:57:09 | [diff] [blame^] | 13 | // compile-flags:-g |
Michael Woerister | a36e537 | 2013-08-15 10:23:54 | [diff] [blame] | 14 | // debugger:set print pretty off |
Michael Woerister | 93d6328 | 2013-09-06 14:00:08 | [diff] [blame] | 15 | // debugger:rbreak zzz |
Michael Woerister | a36e537 | 2013-08-15 10:23:54 | [diff] [blame] | 16 | // debugger:run |
| 17 | // debugger:finish |
| 18 | |
| 19 | // debugger:print no_padding16 |
| 20 | // check:$1 = {10000, -10001} |
| 21 | |
| 22 | // debugger:print no_padding32 |
| 23 | // check:$2 = {-10002, -10003.5, 10004} |
| 24 | |
| 25 | // debugger:print no_padding64 |
| 26 | // check:$3 = {-10005.5, 10006, 10007} |
| 27 | |
| 28 | // debugger:print no_padding163264 |
| 29 | // check:$4 = {-10008, 10009, 10010, 10011} |
| 30 | |
| 31 | // debugger:print internal_padding |
| 32 | // check:$5 = {10012, -10013} |
| 33 | |
| 34 | // debugger:print padding_at_end |
| 35 | // check:$6 = {-10014, 10015} |
| 36 | |
| 37 | |
| 38 | // This test case mainly makes sure that no field names are generated for tuple structs (as opposed |
Daniel Micay | 67a8ea5 | 2013-09-02 08:59:51 | [diff] [blame] | 39 | // to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal |
| 40 | // structs. |
Michael Woerister | a36e537 | 2013-08-15 10:23:54 | [diff] [blame] | 41 | |
| 42 | struct NoPadding16(u16, i16); |
| 43 | struct NoPadding32(i32, f32, u32); |
| 44 | struct NoPadding64(f64, i64, u64); |
| 45 | struct NoPadding163264(i16, u16, i32, u64); |
| 46 | struct InternalPadding(u16, i64); |
| 47 | struct PaddingAtEnd(i64, u16); |
| 48 | |
| 49 | fn main() { |
| 50 | let no_padding16 = NoPadding16(10000, -10001); |
| 51 | let no_padding32 = NoPadding32(-10002, -10003.5, 10004); |
| 52 | let no_padding64 = NoPadding64(-10005.5, 10006, 10007); |
| 53 | let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011); |
| 54 | |
| 55 | let internal_padding = InternalPadding(10012, -10013); |
| 56 | let padding_at_end = PaddingAtEnd(-10014, 10015); |
| 57 | |
| 58 | zzz(); |
| 59 | } |
| 60 | |
| 61 | fn zzz() {()} |