rust/tests/debuginfo/opt/dead_refs.rs
Jubilee Young 2b0cce040d Ignore all debuginfo tests for LLDB that we do not run in CI
We only run LLDB 1500 in CI. Any test with a min-lldb-version above that
is currently ignored. It's not clear any of these tests actually work
with that LLDB version, and they definitely don't work on LLDB ~2100.
So, ignore them until we fix debuginfo testing.
2026-02-02 18:13:43 -08:00

51 lines
1.1 KiB
Rust

// LLDB 1800+ tests were not tested in CI, broke, and now are disabled
//@ ignore-lldb
//@ min-gdb-version: 13.0
//@ compile-flags: -g -Copt-level=3
//@ disable-gdb-pretty-printers
// Checks that we still can access dead variables from debuginfos.
// === GDB TESTS ===================================================================================
//@ gdb-command:run
//@ gdb-command:print *ref_v0
//@ gdb-check:$1 = 0
//@ gdb-command:print *ref_v1
//@ gdb-check:$2 = 1
//@ gdb-command:print *ref_v2
//@ gdb-check:$3 = 2
// === LLDB TESTS ==================================================================================
//@ lldb-command:run
//@ lldb-command:v *ref_v0
//@ lldb-check:[...] 0
//@ lldb-command:v *ref_v1
//@ lldb-check:[...] 1
//@ lldb-command:v *ref_v2
//@ lldb-check:[...] 2
#![allow(unused_variables)]
use std::hint::black_box;
pub struct Foo(i32, i64, i32);
#[inline(never)]
#[no_mangle]
fn test_ref(ref_foo: &Foo) -> i32 {
let ref_v0 = &ref_foo.0;
let ref_v1 = &ref_foo.1;
let ref_v2 = &ref_foo.2;
ref_foo.0 // #break
}
fn main() {
let foo = black_box(Foo(0, 1, 2));
black_box(test_ref(&foo));
}