Skip to content

Commit 7ec1840

Browse files
authored
Rollup merge of rust-lang#97085 - rylev:test-issue-33172, r=wesleywiser
Add a test for issue rust-lang#33172 Adds a test confirming that rust-lang#33172 has been fixed. CDB has some surprising results as it looks like the supposedly unmangled static's symbol name is prefixed when it shouldn't be. r? ``@wesleywiser`` Closes rust-lang#33172
2 parents 0887113 + 3ea686f commit 7ec1840

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/test/debuginfo/no_mangle-info.rs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// compile-flags:-g
2+
3+
// === GDB TESTS ===================================================================================
4+
// gdb-command:run
5+
// gdb-command:whatis TEST
6+
// gdb-check:type = u64
7+
// gdb-command:whatis no_mangle_info::namespace::OTHER_TEST
8+
// gdb-check:type = u64
9+
10+
// === LLDB TESTS ==================================================================================
11+
// lldb-command:run
12+
// lldb-command:expr TEST
13+
// lldb-check: (unsigned long) $0 = 3735928559
14+
// lldb-command:expr no_mangle_test::namespace::OTHER_TEST
15+
// lldb-check: (unsigned long) $0 = 42
16+
17+
// === CDB TESTS ==================================================================================
18+
// cdb-command: g
19+
// Note: LLDB and GDB allow referring to items that are in the same namespace of the symbol
20+
// we currently have a breakpoint on in an unqualified way. CDB does not, and thus we need to
21+
// refer to it in a fully qualified way.
22+
// cdb-command: dx a!no_mangle_info::TEST
23+
// cdb-check: a!no_mangle_info::TEST : 0xdeadbeef [Type: unsigned __int64]
24+
// cdb-command: dx a!no_mangle_info::namespace::OTHER_TEST
25+
// cdb-check: a!no_mangle_info::namespace::OTHER_TEST : 0x2a [Type: unsigned __int64]
26+
27+
#[no_mangle]
28+
pub static TEST: u64 = 0xdeadbeef;
29+
30+
pub mod namespace {
31+
pub static OTHER_TEST: u64 = 42;
32+
}
33+
34+
pub fn main() {
35+
println!("TEST: {}", TEST);
36+
println!("OTHER TEST: {}", namespace::OTHER_TEST); // #break
37+
}

0 commit comments

Comments
 (0)