rust/tests/debuginfo/limited-debuginfo.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
930 B
Rust

//@ ignore-lldb
//@ compile-flags:-C debuginfo=1
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// Make sure functions have proper names
//@ gdb-command:info functions
//@ gdb-check:fn limited_debuginfo::main();
//@ gdb-check:fn limited_debuginfo::some_function();
//@ gdb-check:fn limited_debuginfo::some_other_function();
//@ gdb-check:fn limited_debuginfo::zzz();
//@ gdb-command:run
// Make sure there is no information about locals
//@ gdb-command:info locals
//@ gdb-check:No locals.
//@ gdb-command:continue
#![allow(unused_variables)]
struct Struct {
a: i64,
b: i32
}
fn main() {
some_function(101, 202);
some_other_function(1, 2);
}
fn zzz() {()}
fn some_function(a: isize, b: isize) {
let some_variable = Struct { a: 11, b: 22 };
let some_other_variable = 23;
for x in 0..1 {
zzz(); // #break
}
}
fn some_other_function(a: isize, b: isize) -> bool { true }