1 // ignore-lldb: FIXME(#27089)
2 // min-lldb-version: 310
4 // Require LLVM with DW_TAG_variant_part and a gdb that can read it.
5 // min-system-llvm-version: 8.0
6 // min-gdb-version: 8.2
10 // === GDB TESTS ===================================================================================
13 // gdb-command:print eight_bytes1
14 // gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100)
16 // gdb-command:print four_bytes1
17 // gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101)
19 // gdb-command:print two_bytes1
20 // gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102)
22 // gdb-command:print one_byte1
23 // gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65)
26 // gdb-command:print eight_bytes2
27 // gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100)
29 // gdb-command:print four_bytes2
30 // gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101)
32 // gdb-command:print two_bytes2
33 // gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102)
35 // gdb-command:print one_byte2
36 // gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65)
38 // gdb-command:continue
40 // === LLDB TESTS ==================================================================================
43 // lldb-command:print eight_bytes1
44 // lldb-check:[...]$0 = Variant1(100)
45 // lldb-command:print four_bytes1
46 // lldb-check:[...]$1 = Variant1(101)
47 // lldb-command:print two_bytes1
48 // lldb-check:[...]$2 = Variant1(102)
49 // lldb-command:print one_byte1
50 // lldb-check:[...]$3 = Variant1('A')
52 // lldb-command:print eight_bytes2
53 // lldb-check:[...]$4 = Variant2(100)
54 // lldb-command:print four_bytes2
55 // lldb-check:[...]$5 = Variant2(101)
56 // lldb-command:print two_bytes2
57 // lldb-check:[...]$6 = Variant2(102)
58 // lldb-command:print one_byte2
59 // lldb-check:[...]$7 = Variant2('A')
61 // lldb-command:continue
63 #![allow(unused_variables)]
65 #![feature(omit_gdb_pretty_printer_section)]
66 #![omit_gdb_pretty_printer_section]
68 // This test case makes sure that we get correct type descriptions for the enum
69 // discriminant of different instantiations of the same generic enum type where,
70 // dependending on the generic type parameter(s), the discriminant has a
71 // different size in memory.
79 // These are ordered for descending size on purpose
80 let eight_bytes1 = Enum::Variant1(100.0f64);
81 let four_bytes1 = Enum::Variant1(101i32);
82 let two_bytes1 = Enum::Variant1(102i16);
83 let one_byte1 = Enum::Variant1(65u8);
85 let eight_bytes2 = Enum::Variant2(100.0f64);
86 let four_bytes2 = Enum::Variant2(101i32);
87 let two_bytes2 = Enum::Variant2(102i16);
88 let one_byte2 = Enum::Variant2(65u8);