rust/tests/codegen/inline-debuginfo.rs
Arthur Eubanks 6c348aca4e Adjust dbg.value/dbg.declare checks for LLVM update
https://github.com/llvm/llvm-project/pull/89799 changes llvm.dbg.value/declare intrinsics to be in a different, out-of-instruction-line representation. For example
  call void @llvm.dbg.declare(...)
becomes
  #dbg_declare(...)

Update tests accordingly to work with both the old and new way.
2024-05-06 23:15:48 +00:00

18 lines
496 B
Rust

#![crate_type="rlib"]
//@ compile-flags: -Copt-level=3 -g
//
#[no_mangle]
#[inline(always)]
pub extern "C" fn callee(x: u32) -> u32 {
x + 4
}
// CHECK-LABEL: caller
// CHECK: dbg{{.}}value({{(metadata )?}}i32 %y, {{(metadata )?}}!{{.*}}, {{(metadata )?}}!DIExpression(DW_OP_constu, 3, DW_OP_minus, DW_OP_stack_value){{.*}} [[A:![0-9]+]]
// CHECK: [[A]] = !DILocation(line: {{.*}}, scope: {{.*}}, inlinedAt: {{.*}})
#[no_mangle]
pub extern "C" fn caller(y: u32) -> u32 {
callee(y - 3)
}