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 | |
Michael Woerister | a36e537 | 2013-08-15 10:23:54 | [diff] [blame] | 11 | // compile-flags:-Z extra-debug-info |
| 12 | // debugger:set print pretty off |
| 13 | // debugger:break zzz |
| 14 | // debugger:run |
| 15 | // debugger:finish |
| 16 | |
| 17 | // debugger:print no_padding16 |
| 18 | // check:$1 = {10000, -10001} |
| 19 | |
| 20 | // debugger:print no_padding32 |
| 21 | // check:$2 = {-10002, -10003.5, 10004} |
| 22 | |
| 23 | // debugger:print no_padding64 |
| 24 | // check:$3 = {-10005.5, 10006, 10007} |
| 25 | |
| 26 | // debugger:print no_padding163264 |
| 27 | // check:$4 = {-10008, 10009, 10010, 10011} |
| 28 | |
| 29 | // debugger:print internal_padding |
| 30 | // check:$5 = {10012, -10013} |
| 31 | |
| 32 | // debugger:print padding_at_end |
| 33 | // check:$6 = {-10014, 10015} |
| 34 | |
| 35 | |
| 36 | // 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^] | 37 | // to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal |
| 38 | // structs. |
Michael Woerister | a36e537 | 2013-08-15 10:23:54 | [diff] [blame] | 39 | |
| 40 | struct NoPadding16(u16, i16); |
| 41 | struct NoPadding32(i32, f32, u32); |
| 42 | struct NoPadding64(f64, i64, u64); |
| 43 | struct NoPadding163264(i16, u16, i32, u64); |
| 44 | struct InternalPadding(u16, i64); |
| 45 | struct PaddingAtEnd(i64, u16); |
| 46 | |
| 47 | fn main() { |
| 48 | let no_padding16 = NoPadding16(10000, -10001); |
| 49 | let no_padding32 = NoPadding32(-10002, -10003.5, 10004); |
| 50 | let no_padding64 = NoPadding64(-10005.5, 10006, 10007); |
| 51 | let no_padding163264 = NoPadding163264(-10008, 10009, 10010, 10011); |
| 52 | |
| 53 | let internal_padding = InternalPadding(10012, -10013); |
| 54 | let padding_at_end = PaddingAtEnd(-10014, 10015); |
| 55 | |
| 56 | zzz(); |
| 57 | } |
| 58 | |
| 59 | fn zzz() {()} |