]> git.proxmox.com Git - rustc.git/blob - tests/debuginfo/no_mangle-info.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / debuginfo / no_mangle-info.rs
1 // compile-flags:-g
2 // min-gdb-version: 10.1
3
4 // === GDB TESTS ===================================================================================
5 // gdb-command:run
6 // gdb-command:p TEST
7 // gdb-check:$1 = 3735928559
8 // gdb-command:p no_mangle_info::namespace::OTHER_TEST
9 // gdb-check:$2 = 42
10
11 // === LLDB TESTS ==================================================================================
12 // lldb-command:run
13 // lldb-command:p TEST
14 // lldb-check: (unsigned long) $0 = 3735928559
15 // lldb-command:p OTHER_TEST
16 // lldb-check: (unsigned long) $1 = 42
17
18 // === CDB TESTS ==================================================================================
19 // cdb-command: g
20 // Note: LLDB and GDB allow referring to items that are in the same namespace of the symbol
21 // we currently have a breakpoint on in an unqualified way. CDB does not, and thus we need to
22 // refer to it in a fully qualified way.
23 // cdb-command: dx a!no_mangle_info::TEST
24 // cdb-check: a!no_mangle_info::TEST : 0xdeadbeef [Type: unsigned __int64]
25 // cdb-command: dx a!no_mangle_info::namespace::OTHER_TEST
26 // cdb-check: a!no_mangle_info::namespace::OTHER_TEST : 0x2a [Type: unsigned __int64]
27
28 #[no_mangle]
29 pub static TEST: u64 = 0xdeadbeef;
30
31 // FIXME(rylev, wesleywiser): uncommenting this item breaks the test, and we're not sure why
32 // pub static OTHER_TEST: u64 = 43;
33 pub mod namespace {
34 pub static OTHER_TEST: u64 = 42;
35 }
36
37 pub fn main() {
38 println!("TEST: {}", TEST);
39 println!("OTHER TEST: {}", namespace::OTHER_TEST); // #break
40 }