]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/struct-namespace.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / debuginfo / struct-namespace.rs
1 // Copyright 2013-2016 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 // ignore-gdb
12 // compile-flags:-g
13 // min-lldb-version: 310
14
15 // Check that structs get placed in the correct namespace
16
17 // lldb-command:run
18 // lldb-command:p struct1
19 // lldbg-check:(struct_namespace::Struct1) $0 = [...]
20 // lldbr-check:(struct_namespace::Struct1) struct1 = Struct1 { a: 0, b: 1 }
21 // lldb-command:p struct2
22 // lldbg-check:(struct_namespace::Struct2) $1 = [...]
23 // lldbr-check:(struct_namespace::Struct2) struct2 = { = 2 }
24
25 // lldb-command:p mod1_struct1
26 // lldbg-check:(struct_namespace::mod1::Struct1) $2 = [...]
27 // lldbr-check:(struct_namespace::mod1::Struct1) mod1_struct1 = Struct1 { a: 3, b: 4 }
28 // lldb-command:p mod1_struct2
29 // lldbg-check:(struct_namespace::mod1::Struct2) $3 = [...]
30 // lldbr-check:(struct_namespace::mod1::Struct2) mod1_struct2 = { = 5 }
31
32 #![allow(unused_variables)]
33 #![allow(dead_code)]
34 #![feature(omit_gdb_pretty_printer_section)]
35 #![omit_gdb_pretty_printer_section]
36
37 struct Struct1 {
38 a: u32,
39 b: u64,
40 }
41
42 struct Struct2(u32);
43
44 mod mod1 {
45
46 pub struct Struct1 {
47 pub a: u32,
48 pub b: u64,
49 }
50
51 pub struct Struct2(pub u32);
52 }
53
54
55 fn main() {
56 let struct1 = Struct1 {
57 a: 0,
58 b: 1,
59 };
60
61 let struct2 = Struct2(2);
62
63 let mod1_struct1 = mod1::Struct1 {
64 a: 3,
65 b: 4,
66 };
67
68 let mod1_struct2 = mod1::Struct2(5);
69
70 zzz(); // #break
71 }
72
73 #[inline(never)]
74 fn zzz() {()}