Skip to content

Commit 61d2a63

Browse files
---
yaml --- r: 63765 b: refs/heads/snap-stage3 c: 5f97a6e h: refs/heads/master i: 63763: 0901e24 v: v3
1 parent 65b93ed commit 61d2a63

File tree

2 files changed

+152
-1
lines changed

2 files changed

+152
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 36aa04b9aba097ad8f86a873066dda1b417c14e5
4+
refs/heads/snap-stage3: 5f97a6e951bfd45743c9153fc78743462472351b
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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

Comments
 (0)