Skip to content

Commit

Permalink
Add an inlining debuginfo test
Browse files Browse the repository at this point in the history
  • Loading branch information
oli committed Oct 26, 2020
1 parent 7101ce9 commit 7ae8bc3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/codegen/inline-debuginfo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![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: call void @llvm.dbg.value(metadata i32 %y, metadata !{{.*}}, metadata !DIExpression(DW_OP_constu, 3, DW_OP_minus, DW_OP_stack_value)), !dbg [[A:!.*]]
// CHECK: [[A]] = !DILocation(line: {{.*}}, scope: {{.*}}, inlinedAt: {{.*}})
#[no_mangle]
pub extern "C" fn caller(y: u32) -> u32 {
callee(y - 3)
}

0 comments on commit 7ae8bc3

Please sign in to comment.