1 // Copyright 2013-2014 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.
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.
11 // ignore-tidy-linelength
13 // min-lldb-version: 310
19 // gdb-command:print no_padding1
20 // gdb-check:$1 = {x = {__0 = 0, __1 = 1}, y = 2, z = {__0 = 3, __1 = 4, __2 = 5}}
21 // gdb-command:print no_padding2
22 // gdb-check:$2 = {x = {__0 = 6, __1 = 7}, y = {__0 = {__0 = 8, __1 = 9}, __1 = 10}}
24 // gdb-command:print tuple_internal_padding
25 // gdb-check:$3 = {x = {__0 = 11, __1 = 12}, y = {__0 = 13, __1 = 14}}
26 // gdb-command:print struct_internal_padding
27 // gdb-check:$4 = {x = {__0 = 15, __1 = 16}, y = {__0 = 17, __1 = 18}}
28 // gdb-command:print both_internally_padded
29 // gdb-check:$5 = {x = {__0 = 19, __1 = 20, __2 = 21}, y = {__0 = 22, __1 = 23}}
31 // gdb-command:print single_tuple
32 // gdb-check:$6 = {x = {__0 = 24, __1 = 25, __2 = 26}}
34 // gdb-command:print tuple_padded_at_end
35 // gdb-check:$7 = {x = {__0 = 27, __1 = 28}, y = {__0 = 29, __1 = 30}}
36 // gdb-command:print struct_padded_at_end
37 // gdb-check:$8 = {x = {__0 = 31, __1 = 32}, y = {__0 = 33, __1 = 34}}
38 // gdb-command:print both_padded_at_end
39 // gdb-check:$9 = {x = {__0 = 35, __1 = 36, __2 = 37}, y = {__0 = 38, __1 = 39}}
41 // gdb-command:print mixed_padding
42 // gdb-check:$10 = {x = {__0 = {__0 = 40, __1 = 41, __2 = 42}, __1 = {__0 = 43, __1 = 44}}, y = {__0 = 45, __1 = 46, __2 = 47, __3 = 48}}
44 #![allow(unused_variables)]
45 #![feature(omit_gdb_pretty_printer_section)]
46 #![omit_gdb_pretty_printer_section]
59 struct TupleInternalPadding {
64 struct StructInternalPadding {
69 struct BothInternallyPadded {
78 struct TuplePaddedAtEnd {
83 struct StructPaddedAtEnd {
88 struct BothPaddedAtEnd {
93 // Data-layout (padding signified by dots, one column = 2 bytes):
94 // [a.bbc...ddddee..ffffg.hhi...]
96 x: ((i16, i32, i16), (i64, i32)),
97 y: (i64, i16, i32, i16)
102 let no_padding1 = NoPadding1 {
108 let no_padding2 = NoPadding2 {
113 let tuple_internal_padding = TupleInternalPadding {
118 let struct_internal_padding = StructInternalPadding {
123 let both_internally_padded = BothInternallyPadded {
128 let single_tuple = SingleTuple {
132 let tuple_padded_at_end = TuplePaddedAtEnd {
137 let struct_padded_at_end = StructPaddedAtEnd {
142 let both_padded_at_end = BothPaddedAtEnd {
147 let mixed_padding = MixedPadding {
148 x: ((40, 41, 42), (43, 44)),