Skip to content

Commit 6bcf01a

Browse files
committed
Auto merge of #97085 - rylev:test-issue-33172, r=wesleywiser
Add a test for issue #33172 Adds a test confirming that #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 #33172
2 parents 2da8820 + 6cc3b41 commit 6bcf01a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/test/debuginfo/no_mangle-info.rs

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
}

0 commit comments

Comments
 (0)