]>
Commit | Line | Data |
---|---|---|
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. | |
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 | // ignore-tidy-linelength | |
12 | // min-lldb-version: 310 | |
13 | ||
14 | // compile-flags:-g | |
15 | ||
16 | // === GDB TESTS =================================================================================== | |
17 | ||
18 | // gdb-command:run | |
19 | ||
20 | // gdb-command:print three_simple_structs | |
21 | // gdbg-check:$1 = {x = {x = 1}, y = {x = 2}, z = {x = 3}} | |
22 | // gdbr-check:$1 = struct_in_struct::ThreeSimpleStructs {x: struct_in_struct::Simple {x: 1}, y: struct_in_struct::Simple {x: 2}, z: struct_in_struct::Simple {x: 3}} | |
23 | ||
24 | // gdb-command:print internal_padding_parent | |
25 | // gdbg-check:$2 = {x = {x = 4, y = 5}, y = {x = 6, y = 7}, z = {x = 8, y = 9}} | |
26 | // gdbr-check:$2 = struct_in_struct::InternalPaddingParent {x: struct_in_struct::InternalPadding {x: 4, y: 5}, y: struct_in_struct::InternalPadding {x: 6, y: 7}, z: struct_in_struct::InternalPadding {x: 8, y: 9}} | |
27 | ||
28 | // gdb-command:print padding_at_end_parent | |
29 | // gdbg-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}} | |
30 | // gdbr-check:$3 = struct_in_struct::PaddingAtEndParent {x: struct_in_struct::PaddingAtEnd {x: 10, y: 11}, y: struct_in_struct::PaddingAtEnd {x: 12, y: 13}, z: struct_in_struct::PaddingAtEnd {x: 14, y: 15}} | |
31 | ||
32 | ||
33 | // === LLDB TESTS ================================================================================== | |
34 | ||
35 | // lldb-command:run | |
36 | ||
37 | // lldb-command:print three_simple_structs | |
38 | // lldbg-check:[...]$0 = ThreeSimpleStructs { x: Simple { x: 1 }, y: Simple { x: 2 }, z: Simple { x: 3 } } | |
39 | // lldbr-check:(struct_in_struct::ThreeSimpleStructs) three_simple_structs = ThreeSimpleStructs { x: Simple { x: 1 }, y: Simple { x: 2 }, z: Simple { x: 3 } } | |
40 | ||
41 | // lldb-command:print internal_padding_parent | |
42 | // lldbg-check:[...]$1 = InternalPaddingParent { x: InternalPadding { x: 4, y: 5 }, y: InternalPadding { x: 6, y: 7 }, z: InternalPadding { x: 8, y: 9 } } | |
43 | // lldbr-check:(struct_in_struct::InternalPaddingParent) internal_padding_parent = InternalPaddingParent { x: InternalPadding { x: 4, y: 5 }, y: InternalPadding { x: 6, y: 7 }, z: InternalPadding { x: 8, y: 9 } } | |
44 | ||
45 | // lldb-command:print padding_at_end_parent | |
46 | // lldbg-check:[...]$2 = PaddingAtEndParent { x: PaddingAtEnd { x: 10, y: 11 }, y: PaddingAtEnd { x: 12, y: 13 }, z: PaddingAtEnd { x: 14, y: 15 } } | |
47 | // lldbr-check:(struct_in_struct::PaddingAtEndParent) padding_at_end_parent = PaddingAtEndParent { x: PaddingAtEnd { x: 10, y: 11 }, y: PaddingAtEnd { x: 12, y: 13 }, z: PaddingAtEnd { x: 14, y: 15 } } | |
48 | ||
49 | // lldb-command:print mixed | |
50 | // lldbg-check:[...]$3 = Mixed { x: PaddingAtEnd { x: 16, y: 17 }, y: InternalPadding { x: 18, y: 19 }, z: Simple { x: 20 }, w: 21 } | |
51 | // lldbr-check:(struct_in_struct::Mixed) mixed = Mixed { x: PaddingAtEnd { x: 16, y: 17 }, y: InternalPadding { x: 18, y: 19 }, z: Simple { x: 20 }, w: 21 } | |
52 | ||
53 | // lldb-command:print bag | |
54 | // lldbg-check:[...]$4 = Bag { x: Simple { x: 22 } } | |
55 | // lldbr-check:(struct_in_struct::Bag) bag = Bag { x: Simple { x: 22 } } | |
56 | ||
57 | // lldb-command:print bag_in_bag | |
58 | // lldbg-check:[...]$5 = BagInBag { x: Bag { x: Simple { x: 23 } } } | |
59 | // lldbr-check:(struct_in_struct::BagInBag) bag_in_bag = BagInBag { x: Bag { x: Simple { x: 23 } } } | |
60 | ||
61 | // lldb-command:print tjo | |
62 | // lldbg-check:[...]$6 = ThatsJustOverkill { x: BagInBag { x: Bag { x: Simple { x: 24 } } } } | |
63 | // lldbr-check:(struct_in_struct::ThatsJustOverkill) tjo = ThatsJustOverkill { x: BagInBag { x: Bag { x: Simple { x: 24 } } } } | |
64 | ||
65 | // lldb-command:print tree | |
66 | // lldbg-check:[...]$7 = Tree { x: Simple { x: 25 }, y: InternalPaddingParent { x: InternalPadding { x: 26, y: 27 }, y: InternalPadding { x: 28, y: 29 }, z: InternalPadding { x: 30, y: 31 } }, z: BagInBag { x: Bag { x: Simple { x: 32 } } } } | |
67 | // lldbr-check:(struct_in_struct::Tree) tree = Tree { x: Simple { x: 25 }, y: InternalPaddingParent { x: InternalPadding { x: 26, y: 27 }, y: InternalPadding { x: 28, y: 29 }, z: InternalPadding { x: 30, y: 31 } }, z: BagInBag { x: Bag { x: Simple { x: 32 } } } } | |
68 | ||
69 | #![allow(unused_variables)] | |
70 | #![feature(omit_gdb_pretty_printer_section)] | |
71 | #![omit_gdb_pretty_printer_section] | |
72 | ||
73 | struct Simple { | |
74 | x: i32 | |
75 | } | |
76 | ||
77 | struct InternalPadding { | |
78 | x: i32, | |
79 | y: i64 | |
80 | } | |
81 | ||
82 | struct PaddingAtEnd { | |
83 | x: i64, | |
84 | y: i32 | |
85 | } | |
86 | ||
87 | struct ThreeSimpleStructs { | |
88 | x: Simple, | |
89 | y: Simple, | |
90 | z: Simple | |
91 | } | |
92 | ||
93 | struct InternalPaddingParent { | |
94 | x: InternalPadding, | |
95 | y: InternalPadding, | |
96 | z: InternalPadding | |
97 | } | |
98 | ||
99 | struct PaddingAtEndParent { | |
100 | x: PaddingAtEnd, | |
101 | y: PaddingAtEnd, | |
102 | z: PaddingAtEnd | |
103 | } | |
104 | ||
105 | struct Mixed { | |
106 | x: PaddingAtEnd, | |
107 | y: InternalPadding, | |
108 | z: Simple, | |
109 | w: i16 | |
110 | } | |
111 | ||
112 | struct Bag { | |
113 | x: Simple | |
114 | } | |
115 | ||
116 | struct BagInBag { | |
117 | x: Bag | |
118 | } | |
119 | ||
120 | struct ThatsJustOverkill { | |
121 | x: BagInBag | |
122 | } | |
123 | ||
124 | struct Tree { | |
125 | x: Simple, | |
126 | y: InternalPaddingParent, | |
127 | z: BagInBag | |
128 | } | |
129 | ||
130 | fn main() { | |
131 | ||
132 | let three_simple_structs = ThreeSimpleStructs { | |
133 | x: Simple { x: 1 }, | |
134 | y: Simple { x: 2 }, | |
135 | z: Simple { x: 3 } | |
136 | }; | |
137 | ||
138 | let internal_padding_parent = InternalPaddingParent { | |
139 | x: InternalPadding { x: 4, y: 5 }, | |
140 | y: InternalPadding { x: 6, y: 7 }, | |
141 | z: InternalPadding { x: 8, y: 9 } | |
142 | }; | |
143 | ||
144 | let padding_at_end_parent = PaddingAtEndParent { | |
145 | x: PaddingAtEnd { x: 10, y: 11 }, | |
146 | y: PaddingAtEnd { x: 12, y: 13 }, | |
147 | z: PaddingAtEnd { x: 14, y: 15 } | |
148 | }; | |
149 | ||
150 | let mixed = Mixed { | |
151 | x: PaddingAtEnd { x: 16, y: 17 }, | |
152 | y: InternalPadding { x: 18, y: 19 }, | |
153 | z: Simple { x: 20 }, | |
154 | w: 21 | |
155 | }; | |
156 | ||
157 | let bag = Bag { x: Simple { x: 22 } }; | |
158 | let bag_in_bag = BagInBag { | |
159 | x: Bag { | |
160 | x: Simple { x: 23 } | |
161 | } | |
162 | }; | |
163 | ||
164 | let tjo = ThatsJustOverkill { | |
165 | x: BagInBag { | |
166 | x: Bag { | |
167 | x: Simple { x: 24 } | |
168 | } | |
169 | } | |
170 | }; | |
171 | ||
172 | let tree = Tree { | |
173 | x: Simple { x: 25 }, | |
174 | y: InternalPaddingParent { | |
175 | x: InternalPadding { x: 26, y: 27 }, | |
176 | y: InternalPadding { x: 28, y: 29 }, | |
177 | z: InternalPadding { x: 30, y: 31 } | |
178 | }, | |
179 | z: BagInBag { | |
180 | x: Bag { | |
181 | x: Simple { x: 32 } | |
182 | } | |
183 | } | |
184 | }; | |
185 | ||
186 | zzz(); // #break | |
187 | } | |
188 | ||
189 | fn zzz() {()} |