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

28 lines
981 B
Rust

//@ ignore-lldb
//@ ignore-aarch64
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ gdb-command:run
//@ gdb-command:next
//@ gdb-check:[...]22[...]let s = Some(5).unwrap(); // #break
//@ gdb-command:continue
// IF YOU MODIFY THIS FILE, BE CAREFUL TO ADAPT THE LINE NUMBERS IN THE DEBUGGER COMMANDS
// This test makes sure that gdb does not set unwanted breakpoints in inlined functions. If a
// breakpoint existed in unwrap(), then calling `next` would (when stopped at `let s = ...`) stop
// in unwrap() instead of stepping over the function invocation. By making sure that `s` is
// contained in the output, after calling `next` just once, we can be sure that we did not stop in
// unwrap(). (The testing framework doesn't allow for checking that some text is *not* contained in
// the output, which is why we have to make the test in this kind of roundabout way)
fn bar() -> isize {
let s = Some(5).unwrap(); // #break
s
}
fn main() {
let _ = bar();
}