diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/debuginfo/no_mangle-info.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/debuginfo/no_mangle-info.rs')
-rw-r--r-- | tests/debuginfo/no_mangle-info.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/debuginfo/no_mangle-info.rs b/tests/debuginfo/no_mangle-info.rs new file mode 100644 index 000000000..e22d36874 --- /dev/null +++ b/tests/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 +} |