2022-05-16 15:54:12 +00:00
|
|
|
// compile-flags:-g
|
2022-08-04 09:46:30 +00:00
|
|
|
// min-gdb-version: 10.1
|
2022-05-16 15:54:12 +00:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
// gdb-command:run
|
2022-06-21 12:53:55 +00:00
|
|
|
// gdb-command:p TEST
|
|
|
|
// gdb-check:$1 = 3735928559
|
|
|
|
// gdb-command:p no_mangle_info::namespace::OTHER_TEST
|
|
|
|
// gdb-check:$2 = 42
|
2022-05-16 15:54:12 +00:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
// lldb-command:run
|
2022-06-21 12:53:55 +00:00
|
|
|
// lldb-command:p TEST
|
2022-05-16 15:54:12 +00:00
|
|
|
// lldb-check: (unsigned long) $0 = 3735928559
|
2022-06-21 12:53:55 +00:00
|
|
|
// lldb-command:p OTHER_TEST
|
|
|
|
// lldb-check: (unsigned long) $1 = 42
|
2022-05-16 15:54:12 +00:00
|
|
|
|
|
|
|
// === CDB TESTS ==================================================================================
|
2022-06-20 16:45:08 +00:00
|
|
|
// 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]
|
2022-05-16 15:54:12 +00:00
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
pub static TEST: u64 = 0xdeadbeef;
|
|
|
|
|
2022-06-23 10:02:07 +00:00
|
|
|
// FIXME(rylev, wesleywiser): uncommenting this item breaks the test, and we're not sure why
|
2022-06-21 15:10:46 +00:00
|
|
|
// pub static OTHER_TEST: u64 = 43;
|
2022-06-20 16:45:08 +00:00
|
|
|
pub mod namespace {
|
|
|
|
pub static OTHER_TEST: u64 = 42;
|
|
|
|
}
|
|
|
|
|
2022-05-16 15:54:12 +00:00
|
|
|
pub fn main() {
|
2022-06-20 16:45:08 +00:00
|
|
|
println!("TEST: {}", TEST);
|
|
|
|
println!("OTHER TEST: {}", namespace::OTHER_TEST); // #break
|
2022-05-16 15:54:12 +00:00
|
|
|
}
|