rust/tests/debuginfo/collapse-debuginfo-static-external.rs
Martin Nordholts 5b57d02e9f compiletest: Use //@ prefixes also for debuginfo test directives
So that when we later add support for revisions we can use the same
syntax for revisions as elsewhere.

This also prevents people from making typos for commands since
`src/tools/compiletest/src/directives/directive_names.rs` will catch such
typos now.

Note that we one FIXME for a non-trivial change for later:
```
// FIXME(148097): Change `// cdb-checksimple_closure` to `//@ cdb-check:simple_closure`
```
2025-11-25 06:13:45 +01:00

25 lines
564 B
Rust

//@ ignore-lldb
// Test that static debug info is not collapsed with #[collapse_debuginfo(external)]
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
//@ gdb-command:info line collapse_debuginfo_static_external::FOO
//@ gdb-check:[...]Line 16[...]
#[collapse_debuginfo(external)]
macro_rules! decl_foo {
() => {
static FOO: u32 = 0;
};
}
decl_foo!();
fn main() {
// prevent FOO from getting optimized out
std::hint::black_box(&FOO);
}