]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/struct-namespace.rs
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.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 // lldb-check:(struct_namespace::Struct1) $0 = [...]
20 // lldb-command:p struct2
21 // lldb-check:(struct_namespace::Struct2) $1 = [...]
22
23 // lldb-command:p mod1_struct1
24 // lldb-check:(struct_namespace::mod1::Struct1) $2 = [...]
25 // lldb-command:p mod1_struct2
26 // lldb-check:(struct_namespace::mod1::Struct2) $3 = [...]
27
28 #![allow(unused_variables)]
29 #![allow(dead_code)]
30 #![feature(omit_gdb_pretty_printer_section)]
31 #![omit_gdb_pretty_printer_section]
32
33 struct Struct1 {
34     a: u32,
35     b: u64,
36 }
37
38 struct Struct2(u32);
39
40 mod mod1 {
41
42     pub struct Struct1 {
43         pub a: u32,
44         pub b: u64,
45     }
46
47     pub struct Struct2(pub u32);
48 }
49
50
51 fn main() {
52     let struct1 = Struct1 {
53         a: 0,
54         b: 1,
55     };
56
57     let struct2 = Struct2(2);
58
59     let mod1_struct1 = mod1::Struct1 {
60         a: 3,
61         b: 4,
62     };
63
64     let mod1_struct2 = mod1::Struct2(5);
65
66     zzz(); // #break
67 }
68
69 #[inline(never)]
70 fn zzz() {()}