rust/tests/debuginfo/dummy_span.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

46 lines
1.1 KiB
Rust

//@ min-lldb-version: 310
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
//@ gdb-command:run 7
//@ gdb-command:next
//@ gdb-command:next
//@ gdb-check:[...]#loc1[...]
//@ gdb-command:next
//@ gdb-check:[...]#loc2[...]
// === LLDB TESTS ==================================================================================
//@ lldb-command:run 7
//@ lldb-command:next
//@ lldb-command:next
//@ lldb-command:frame select
//@ lldb-check:[...]#loc1[...]
//@ lldb-command:next
//@ lldb-command:frame select
//@ lldb-check:[...]#loc2[...]
use std::env;
use std::num::ParseIntError;
fn main() -> Result<(), ParseIntError> {
let args = env::args();
let number_str = args.skip(1).next().unwrap();
let number = number_str.parse::<i32>()?;
zzz(); // #break
if number % 7 == 0 {
// This generates code with a dummy span for
// some reason. If that ever changes this
// test will not test what it wants to test.
return Ok(()); // #loc1
}
println!("{}", number);
Ok(())
} // #loc2
fn zzz() { () }