]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/boxed-struct.rs
Auto merge of #83819 - AngelicosPhosphoros:issue-73338-fix-partial-eq-impl, r=Mark...
[rust.git] / src / test / debuginfo / boxed-struct.rs
1 // min-lldb-version: 310
2
3 // compile-flags:-g
4
5 // === GDB TESTS ===================================================================================
6
7 // gdb-command:run
8
9 // gdb-command:print *boxed_with_padding
10 // gdbg-check:$1 = {x = 99, y = 999, z = 9999, w = 99999}
11 // gdbr-check:$1 = boxed_struct::StructWithSomePadding {x: 99, y: 999, z: 9999, w: 99999}
12
13 // gdb-command:print *boxed_with_dtor
14 // gdbg-check:$2 = {x = 77, y = 777, z = 7777, w = 77777}
15 // gdbr-check:$2 = boxed_struct::StructWithDestructor {x: 77, y: 777, z: 7777, w: 77777}
16
17
18 // === LLDB TESTS ==================================================================================
19
20 // lldb-command:run
21
22 // lldb-command:print *boxed_with_padding
23 // lldbg-check:[...]$0 = { x = 99 y = 999 z = 9999 w = 99999 }
24 // lldbr-check:(boxed_struct::StructWithSomePadding) *boxed_with_padding = { x = 99 y = 999 z = 9999 w = 99999 }
25
26 // lldb-command:print *boxed_with_dtor
27 // lldbg-check:[...]$1 = { x = 77 y = 777 z = 7777 w = 77777 }
28 // lldbr-check:(boxed_struct::StructWithDestructor) *boxed_with_dtor = { x = 77 y = 777 z = 7777 w = 77777 }
29
30 #![allow(unused_variables)]
31 #![feature(box_syntax)]
32 #![feature(omit_gdb_pretty_printer_section)]
33 #![omit_gdb_pretty_printer_section]
34
35 struct StructWithSomePadding {
36     x: i16,
37     y: i32,
38     z: i32,
39     w: i64
40 }
41
42 struct StructWithDestructor {
43     x: i16,
44     y: i32,
45     z: i32,
46     w: i64
47 }
48
49 impl Drop for StructWithDestructor {
50     fn drop(&mut self) {}
51 }
52
53 fn main() {
54
55     let boxed_with_padding: Box<_> = box StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 };
56
57     let boxed_with_dtor: Box<_> = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 };
58     zzz(); // #break
59 }
60
61 fn zzz() { () }