]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/boxed-struct.rs
dd543405e4c27d1070cfcf98e5201360aaf536a1
[rustc.git] / src / test / debuginfo / boxed-struct.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // min-lldb-version: 310
12
13 // compile-flags:-g
14
15 // === GDB TESTS ===================================================================================
16
17 // gdb-command:run
18
19 // gdb-command:print *unique
20 // gdb-check:$1 = {x = 99, y = 999, z = 9999, w = 99999}
21
22 // gdb-command:print *unique_dtor
23 // gdb-check:$2 = {x = 77, y = 777, z = 7777, w = 77777}
24
25
26 // === LLDB TESTS ==================================================================================
27
28 // lldb-command:run
29
30 // lldb-command:print *unique
31 // lldb-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 }
32
33 // lldb-command:print *unique_dtor
34 // lldb-check:[...]$1 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }
35
36 #![allow(unused_variables)]
37 #![feature(box_syntax)]
38 #![feature(omit_gdb_pretty_printer_section)]
39 #![omit_gdb_pretty_printer_section]
40
41 struct StructWithSomePadding {
42 x: i16,
43 y: i32,
44 z: i32,
45 w: i64
46 }
47
48 struct StructWithDestructor {
49 x: i16,
50 y: i32,
51 z: i32,
52 w: i64
53 }
54
55 impl Drop for StructWithDestructor {
56 fn drop(&mut self) {}
57 }
58
59 fn main() {
60
61 let unique: Box<_> = box StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 };
62
63 let unique_dtor: Box<_> = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 };
64 zzz(); // #break
65 }
66
67 fn zzz() { () }