]>
Commit | Line | Data |
---|---|---|
ba9703b0 | 1 | // Require a gdb that can read DW_TAG_variant_part. |
532ac7d7 XL |
2 | // min-gdb-version: 8.2 |
3 | ||
4 | // compile-flags:-g -Z thinlto | |
5 | ||
6 | // === GDB TESTS =================================================================================== | |
7 | ||
8 | // gdb-command:run | |
9 | ||
10 | // gdb-command:print *abc | |
11 | // gdbr-check:$1 = enum_thinlto::ABC::TheA{x: 0, y: 8970181431921507452} | |
12 | ||
13 | // === LLDB TESTS ================================================================================== | |
14 | ||
15 | // lldb-command:run | |
16 | ||
17 | // lldb-command:print *abc | |
18 | // lldbg-check:(enum_thinlto::ABC) $0 = ABC { } | |
19 | ||
20 | #![allow(unused_variables)] | |
21 | #![feature(omit_gdb_pretty_printer_section)] | |
22 | #![omit_gdb_pretty_printer_section] | |
23 | ||
24 | // The first element is to ensure proper alignment, irrespective of the machines word size. Since | |
25 | // the size of the discriminant value is machine dependent, this has be taken into account when | |
26 | // datatype layout should be predictable as in this case. | |
27 | #[derive(Debug)] | |
28 | enum ABC { | |
29 | TheA { x: i64, y: i64 }, | |
30 | TheB (i64, i32, i32), | |
31 | } | |
32 | ||
33 | fn main() { | |
34 | let abc = ABC::TheA { x: 0, y: 0x7c7c_7c7c_7c7c_7c7c }; | |
35 | ||
36 | f(&abc); | |
37 | } | |
38 | ||
39 | fn f(abc: &ABC) { | |
40 | zzz(); // #break | |
41 | ||
42 | println!("{:?}", abc); | |
43 | } | |
44 | ||
45 | fn zzz() {()} |