diff options
| author | bors <bors@rust-lang.org> | 2022-08-05 03:26:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-05 03:26:47 +0000 |
| commit | 6bcf01afdb1c21a30cdf1fd20f9cdef7c482e753 (patch) | |
| tree | 737b58ed16ad75d476edf4a73f6edac80168533b /src/test | |
| parent | 2da8820470817bfd3053be969fb38be9645e1a3d (diff) | |
| parent | 6cc3b412f827036e07c2e31a275722c452d069f2 (diff) | |
| download | rust-6bcf01afdb1c21a30cdf1fd20f9cdef7c482e753.tar.gz rust-6bcf01afdb1c21a30cdf1fd20f9cdef7c482e753.zip | |
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
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/debuginfo/no_mangle-info.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/debuginfo/no_mangle-info.rs b/src/test/debuginfo/no_mangle-info.rs new file mode 100644 index 00000000000..e22d368745f --- /dev/null +++ b/src/test/debuginfo/no_mangle-info.rs @@ -0,0 +1,40 @@ +// compile-flags:-g +// min-gdb-version: 10.1 + +// === GDB TESTS =================================================================================== +// gdb-command:run +// gdb-command:p TEST +// gdb-check:$1 = 3735928559 +// gdb-command:p no_mangle_info::namespace::OTHER_TEST +// gdb-check:$2 = 42 + +// === LLDB TESTS ================================================================================== +// lldb-command:run +// lldb-command:p TEST +// lldb-check: (unsigned long) $0 = 3735928559 +// lldb-command:p OTHER_TEST +// lldb-check: (unsigned long) $1 = 42 + +// === CDB TESTS ================================================================================== +// cdb-command: g +// Note: LLDB and GDB allow referring to items that are in the same namespace of the symbol +// we currently have a breakpoint on in an unqualified way. CDB does not, and thus we need to +// refer to it in a fully qualified way. +// cdb-command: dx a!no_mangle_info::TEST +// cdb-check: a!no_mangle_info::TEST : 0xdeadbeef [Type: unsigned __int64] +// cdb-command: dx a!no_mangle_info::namespace::OTHER_TEST +// cdb-check: a!no_mangle_info::namespace::OTHER_TEST : 0x2a [Type: unsigned __int64] + +#[no_mangle] +pub static TEST: u64 = 0xdeadbeef; + +// FIXME(rylev, wesleywiser): uncommenting this item breaks the test, and we're not sure why +// pub static OTHER_TEST: u64 = 43; +pub mod namespace { + pub static OTHER_TEST: u64 = 42; +} + +pub fn main() { + println!("TEST: {}", TEST); + println!("OTHER TEST: {}", namespace::OTHER_TEST); // #break +} |
