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
+
11
+ // xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12
+
13
+ // compile-flags:-Z extra-debug-info
14
+ // debugger:set print pretty off
15
+ // debugger:break zzz
16
+ // debugger:run
17
+ // debugger:finish
18
+
19
+ // debugger:print noPadding1
20
+ // check:$1 = {x = {0, 1}, y = 2, z = {3, 4, 5}}
21
+ // debugger:print noPadding2
22
+ // check:$2 = {x = {6, 7}, y = {{8, 9}, 10}}
23
+
24
+ // debugger:print tupleInternalPadding
25
+ // check:$3 = {x = {11, 12}, y = {13, 14}}
26
+ // debugger:print structInternalPadding
27
+ // check:$4 = {x = {15, 16}, y = {17, 18}}
28
+ // debugger:print bothInternallyPadded
29
+ // check:$5 = {x = {19, 20, 21}, y = {22, 23}}
30
+
31
+ // debugger:print singleTuple
32
+ // check:$6 = {x = {24, 25, 26}}
33
+
34
+ // debugger:print tuplePaddedAtEnd
35
+ // check:$7 = {x = {27, 28}, y = {29, 30}}
36
+ // debugger:print structPaddedAtEnd
37
+ // check:$8 = {x = {31, 32}, y = {33, 34}}
38
+ // debugger:print bothPaddedAtEnd
39
+ // check:$9 = {x = {35, 36, 37}, y = {38, 39}}
40
+
41
+ // debugger:print mixedPadding
42
+ // check:$10 = {x = {{40, 41, 42}, {43, 44}}, y = {45, 46, 47, 48}}
43
+
44
+ struct NoPadding1 {
45
+ x : ( i32 , i32 ) ,
46
+ y : i32 ,
47
+ z : ( i32 , i32 , i32 )
48
+ }
49
+
50
+ struct NoPadding2 {
51
+ x : ( i32 , i32 ) ,
52
+ y : ( ( i32 , i32 ) , i32 )
53
+ }
54
+
55
+ struct TupleInternalPadding {
56
+ x : ( i16 , i32 ) ,
57
+ y : ( i32 , i64 )
58
+ }
59
+
60
+ struct StructInternalPadding {
61
+ x : ( i16 , i16 ) ,
62
+ y : ( i64 , i64 )
63
+ }
64
+
65
+ struct BothInternallyPadded {
66
+ x : ( i16 , i32 , i32 ) ,
67
+ y : ( i32 , i64 )
68
+ }
69
+
70
+ struct SingleTuple {
71
+ x : ( i16 , i32 , i64 )
72
+ }
73
+
74
+ struct TuplePaddedAtEnd {
75
+ x : ( i32 , i16 ) ,
76
+ y : ( i64 , i32 )
77
+ }
78
+
79
+ struct StructPaddedAtEnd {
80
+ x : ( i64 , i64 ) ,
81
+ y : ( i16 , i16 )
82
+ }
83
+
84
+ struct BothPaddedAtEnd {
85
+ x : ( i32 , i32 , i16 ) ,
86
+ y : ( i64 , i32 )
87
+ }
88
+
89
+ // Data-layout (padding signified by dots, one column = 2 bytes):
90
+ // [a.bbc...ddddee..ffffg.hhi...]
91
+ struct MixedPadding {
92
+ x : ( ( i16 , i32 , i16 ) , ( i64 , i32 ) ) ,
93
+ y : ( i64 , i16 , i32 , i16 )
94
+ }
95
+
96
+
97
+ fn main ( ) {
98
+ let noPadding1 = NoPadding1 {
99
+ x : ( 0 , 1 ) ,
100
+ y : 2 ,
101
+ z : ( 3 , 4 , 5 )
102
+ } ;
103
+
104
+ let noPadding2 = NoPadding2 {
105
+ x : ( 6 , 7 ) ,
106
+ y : ( ( 8 , 9 ) , 10 )
107
+ } ;
108
+
109
+ let tupleInternalPadding = TupleInternalPadding {
110
+ x : ( 11 , 12 ) ,
111
+ y : ( 13 , 14 )
112
+ } ;
113
+
114
+ let structInternalPadding = StructInternalPadding {
115
+ x : ( 15 , 16 ) ,
116
+ y : ( 17 , 18 )
117
+ } ;
118
+
119
+ let bothInternallyPadded = BothInternallyPadded {
120
+ x : ( 19 , 20 , 21 ) ,
121
+ y : ( 22 , 23 )
122
+ } ;
123
+
124
+ let singleTuple = SingleTuple {
125
+ x : ( 24 , 25 , 26 )
126
+ } ;
127
+
128
+ let tuplePaddedAtEnd = TuplePaddedAtEnd {
129
+ x : ( 27 , 28 ) ,
130
+ y : ( 29 , 30 )
131
+ } ;
132
+
133
+ let structPaddedAtEnd = StructPaddedAtEnd {
134
+ x : ( 31 , 32 ) ,
135
+ y : ( 33 , 34 )
136
+ } ;
137
+
138
+ let bothPaddedAtEnd = BothPaddedAtEnd {
139
+ x : ( 35 , 36 , 37 ) ,
140
+ y : ( 38 , 39 )
141
+ } ;
142
+
143
+ let mixedPadding = MixedPadding {
144
+ x : ( ( 40 , 41 , 42 ) , ( 43 , 44 ) ) ,
145
+ y : ( 45 , 46 , 47 , 48 )
146
+ } ;
147
+
148
+ zzz ( ) ;
149
+ }
150
+
151
+ fn zzz ( ) { ( ) }
0 commit comments