Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for issue #33172 #97085

Merged
merged 7 commits into from
Aug 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/test/debuginfo/no_mangle-info.rs
Original file line number Diff line number Diff line change
@@ -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
wesleywiser marked this conversation as resolved.
Show resolved Hide resolved
// 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]
rylev marked this conversation as resolved.
Show resolved Hide resolved
// 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
}