]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/struct-namespace.rs
Rollup merge of #107580 - lenko-d:default_value_for_a_lifetime_generic_parameter_prod...
[rust.git] / tests / debuginfo / struct-namespace.rs
1 // ignore-gdb
2 // compile-flags:-g
3 // min-lldb-version: 310
4
5 // Check that structs get placed in the correct namespace
6
7 // lldb-command:run
8 // lldb-command:p struct1
9 // lldbg-check:(struct_namespace::Struct1) $0 = [...]
10 // lldbr-check:(struct_namespace::Struct1) struct1 = Struct1 { a: 0, b: 1 }
11 // lldb-command:p struct2
12 // lldbg-check:(struct_namespace::Struct2) $1 = [...]
13 // lldbr-check:(struct_namespace::Struct2) struct2 = { = 2 }
14
15 // lldb-command:p mod1_struct1
16 // lldbg-check:(struct_namespace::mod1::Struct1) $2 = [...]
17 // lldbr-check:(struct_namespace::mod1::Struct1) mod1_struct1 = Struct1 { a: 3, b: 4 }
18 // lldb-command:p mod1_struct2
19 // lldbg-check:(struct_namespace::mod1::Struct2) $3 = [...]
20 // lldbr-check:(struct_namespace::mod1::Struct2) mod1_struct2 = { = 5 }
21
22 #![allow(unused_variables)]
23 #![allow(dead_code)]
24 #![feature(omit_gdb_pretty_printer_section)]
25 #![omit_gdb_pretty_printer_section]
26
27 struct Struct1 {
28     a: u32,
29     b: u64,
30 }
31
32 struct Struct2(u32);
33
34 mod mod1 {
35
36     pub struct Struct1 {
37         pub a: u32,
38         pub b: u64,
39     }
40
41     pub struct Struct2(pub u32);
42 }
43
44
45 fn main() {
46     let struct1 = Struct1 {
47         a: 0,
48         b: 1,
49     };
50
51     let struct2 = Struct2(2);
52
53     let mod1_struct1 = mod1::Struct1 {
54         a: 3,
55         b: 4,
56     };
57
58     let mod1_struct2 = mod1::Struct2(5);
59
60     zzz(); // #break
61 }
62
63 #[inline(never)]
64 fn zzz() {()}