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