1 // ignore-tidy-linelength
2 // min-lldb-version: 310
6 // === GDB TESTS ===================================================================================
10 // gdb-command:print three_simple_structs
11 // gdbg-check:$1 = {x = {x = 1}, y = {x = 2}, z = {x = 3}}
12 // 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}}
14 // gdb-command:print internal_padding_parent
15 // gdbg-check:$2 = {x = {x = 4, y = 5}, y = {x = 6, y = 7}, z = {x = 8, y = 9}}
16 // 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}}
18 // gdb-command:print padding_at_end_parent
19 // gdbg-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}}
20 // 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}}
23 // === LLDB TESTS ==================================================================================
27 // lldb-command:print three_simple_structs
28 // lldbg-check:[...]$0 = { x = { x = 1 } y = { x = 2 } z = { x = 3 } }
29 // lldbr-check:(struct_in_struct::ThreeSimpleStructs) three_simple_structs = { x = { x = 1 } y = { x = 2 } z = { x = 3 } }
31 // lldb-command:print internal_padding_parent
32 // lldbg-check:[...]$1 = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } }
33 // lldbr-check:(struct_in_struct::InternalPaddingParent) internal_padding_parent = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } }
35 // lldb-command:print padding_at_end_parent
36 // lldbg-check:[...]$2 = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } }
37 // lldbr-check:(struct_in_struct::PaddingAtEndParent) padding_at_end_parent = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } }
39 // lldb-command:print mixed
40 // lldbg-check:[...]$3 = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 }
41 // lldbr-check:(struct_in_struct::Mixed) mixed = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 }
43 // lldb-command:print bag
44 // lldbg-check:[...]$4 = { x = { x = 22 } }
45 // lldbr-check:(struct_in_struct::Bag) bag = { x = { x = 22 } }
47 // lldb-command:print bag_in_bag
48 // lldbg-check:[...]$5 = { x = { x = { x = 23 } } }
49 // lldbr-check:(struct_in_struct::BagInBag) bag_in_bag = { x = { x = { x = 23 } } }
51 // lldb-command:print tjo
52 // lldbg-check:[...]$6 = { x = { x = { x = { x = 24 } } } }
53 // lldbr-check:(struct_in_struct::ThatsJustOverkill) tjo = { x = { x = { x = { x = 24 } } } }
55 // lldb-command:print tree
56 // lldbg-check:[...]$7 = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } }
57 // lldbr-check:(struct_in_struct::Tree) tree = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } }
59 #![allow(unused_variables)]
60 #![feature(omit_gdb_pretty_printer_section)]
61 #![omit_gdb_pretty_printer_section]
67 struct InternalPadding {
77 struct ThreeSimpleStructs {
83 struct InternalPaddingParent {
89 struct PaddingAtEndParent {
110 struct ThatsJustOverkill {
116 y: InternalPaddingParent,
122 let three_simple_structs = ThreeSimpleStructs {
128 let internal_padding_parent = InternalPaddingParent {
129 x: InternalPadding { x: 4, y: 5 },
130 y: InternalPadding { x: 6, y: 7 },
131 z: InternalPadding { x: 8, y: 9 }
134 let padding_at_end_parent = PaddingAtEndParent {
135 x: PaddingAtEnd { x: 10, y: 11 },
136 y: PaddingAtEnd { x: 12, y: 13 },
137 z: PaddingAtEnd { x: 14, y: 15 }
141 x: PaddingAtEnd { x: 16, y: 17 },
142 y: InternalPadding { x: 18, y: 19 },
147 let bag = Bag { x: Simple { x: 22 } };
148 let bag_in_bag = BagInBag {
154 let tjo = ThatsJustOverkill {
164 y: InternalPaddingParent {
165 x: InternalPadding { x: 26, y: 27 },
166 y: InternalPadding { x: 28, y: 29 },
167 z: InternalPadding { x: 30, y: 31 }