]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/boxed-struct.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / debuginfo / boxed-struct.rs
CommitLineData
1a4d82fc
JJ
1// min-lldb-version: 310
2
3// compile-flags:-g
4
5// === GDB TESTS ===================================================================================
6
7// gdb-command:run
8
e1599b0c 9// gdb-command:print *boxed_with_padding
c30ab7b3
SL
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}
1a4d82fc 12
e1599b0c 13// gdb-command:print *boxed_with_dtor
c30ab7b3
SL
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}
1a4d82fc
JJ
16
17
18// === LLDB TESTS ==================================================================================
19
20// lldb-command:run
21
e1599b0c 22// lldb-command:print *boxed_with_padding
f035d41b
XL
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 }
1a4d82fc 25
e1599b0c 26// lldb-command:print *boxed_with_dtor
f035d41b
XL
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 }
1a4d82fc
JJ
29
30#![allow(unused_variables)]
31#![feature(box_syntax)]
b039eaaf 32#![feature(omit_gdb_pretty_printer_section)]
1a4d82fc
JJ
33#![omit_gdb_pretty_printer_section]
34
35struct StructWithSomePadding {
36 x: i16,
37 y: i32,
38 z: i32,
39 w: i64
40}
41
42struct StructWithDestructor {
43 x: i16,
44 y: i32,
45 z: i32,
46 w: i64
47}
48
49impl Drop for StructWithDestructor {
50 fn drop(&mut self) {}
51}
52
53fn main() {
54
e1599b0c 55 let boxed_with_padding: Box<_> = box StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 };
1a4d82fc 56
e1599b0c 57 let boxed_with_dtor: Box<_> = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 };
1a4d82fc
JJ
58 zzz(); // #break
59}
60
61fn zzz() { () }