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