1 // min-lldb-version: 310
5 // === GDB TESTS ===================================================================================
9 // gdb-command:print tuple_interior_padding
10 // gdbg-check:$1 = {__0 = 0, __1 = OneHundred}
11 // gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)
13 // gdb-command:print tuple_padding_at_end
14 // gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
15 // gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)
17 // gdb-command:print tuple_different_enums
18 // gdbg-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
19 // gdbr-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna)
21 // gdb-command:print padded_struct
22 // gdbg-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
23 // gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5}
25 // gdb-command:print packed_struct
26 // gdbg-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
27 // gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8}
29 // gdb-command:print non_padded_struct
30 // gdbg-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
31 // gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto}
33 // gdb-command:print struct_with_drop
34 // gdbg-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
35 // gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9)
37 // === LLDB TESTS ==================================================================================
41 // lldb-command:print tuple_interior_padding
42 // lldbg-check:[...]$0 = { 0 = 0 1 = OneHundred }
43 // lldbr-check:((i16, c_style_enum_in_composite::AnEnum)) tuple_interior_padding = { 0 = 0 1 = OneHundred }
45 // lldb-command:print tuple_padding_at_end
46 // lldbg-check:[...]$1 = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }
47 // lldbr-check:(((u64, c_style_enum_in_composite::AnEnum), u64)) tuple_padding_at_end = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }
49 // lldb-command:print tuple_different_enums
50 // lldbg-check:[...]$2 = { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna }
51 // lldbr-check:((c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum, c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum)) tuple_different_enums = { 0 = c_style_enum_in_composite::AnEnum::OneThousand 1 = c_style_enum_in_composite::AnotherEnum::MountainView 2 = c_style_enum_in_composite::AnEnum::OneMillion 3 = c_style_enum_in_composite::AnotherEnum::Vienna }
53 // lldb-command:print padded_struct
54 // lldbg-check:[...]$3 = { a = 3 b = OneMillion c = 4 d = Toronto e = 5 }
55 // lldbr-check:(c_style_enum_in_composite::PaddedStruct) padded_struct = { a = 3 b = c_style_enum_in_composite::AnEnum::OneMillion c = 4 d = Toronto e = 5 }
57 // lldb-command:print packed_struct
58 // lldbg-check:[...]$4 = { a = 6 b = OneHundred c = 7 d = Vienna e = 8 }
59 // lldbr-check:(c_style_enum_in_composite::PackedStruct) packed_struct = { a = 6 b = c_style_enum_in_composite::AnEnum::OneHundred c = 7 d = Vienna e = 8 }
61 // lldb-command:print non_padded_struct
62 // lldbg-check:[...]$5 = { a = OneMillion b = MountainView c = OneThousand d = Toronto }
63 // lldbr-check:(c_style_enum_in_composite::NonPaddedStruct) non_padded_struct = { a = c_style_enum_in_composite::AnEnum::OneMillion, b = c_style_enum_in_composite::AnotherEnum::MountainView, c = c_style_enum_in_composite::AnEnum::OneThousand, d = c_style_enum_in_composite::AnotherEnum::Toronto }
65 // lldb-command:print struct_with_drop
66 // lldbg-check:[...]$6 = { 0 = { a = OneHundred b = Vienna } 1 = 9 }
67 // lldbr-check:((c_style_enum_in_composite::StructWithDrop, i64)) struct_with_drop = { 0 = { a = c_style_enum_in_composite::AnEnum::OneHundred b = c_style_enum_in_composite::AnotherEnum::Vienna } 1 = 9 }
69 #![allow(unused_variables)]
70 #![feature(omit_gdb_pretty_printer_section)]
71 #![omit_gdb_pretty_printer_section]
73 use self::AnEnum::{OneHundred, OneThousand, OneMillion};
74 use self::AnotherEnum::{MountainView, Toronto, Vienna};
105 struct NonPaddedStruct {
112 struct StructWithDrop {
117 impl Drop for StructWithDrop {
118 fn drop(&mut self) {()}
123 let tuple_interior_padding = (0_i16, OneHundred);
124 // It will depend on the machine architecture if any padding is actually involved here
125 let tuple_padding_at_end = ((1_u64, OneThousand), 2_u64);
126 let tuple_different_enums = (OneThousand, MountainView, OneMillion, Vienna);
128 let padded_struct = PaddedStruct {
136 let packed_struct = PackedStruct {
144 let non_padded_struct = NonPaddedStruct {
151 let struct_with_drop = (StructWithDrop { a: OneHundred, b: Vienna }, 9_i64);