Skip to content
Snippets Groups Projects
Commit 5ca58a0a authored by Adrian Prantl's avatar Adrian Prantl
Browse files

Eliminate backend dependency in CFE testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176901 91177308-0d34-0410-b5e6-96231b3b80d8
parent 4c1adcc5
No related branches found
No related tags found
No related merge requests found
// RUN: %clang_cc1 -g -emit-obj -o %t %s // RUN: %clang_cc1 -g -emit-llvm -o - %s | FileCheck %s
// RUN: llvm-dwarfdump %t | FileCheck %s
// In the attached test case a post-r166236 clang coalesces two // Make sure that clang outputs distinct debug info for a function
// instances of an inlined function in a way that makes it appear as // that is inlined twice on the same line. Otherwise it would appear
// if the function was only inlined once. // as if the function was only inlined once.
#define INLINE inline __attribute__((always_inline)) #define INLINE inline __attribute__((always_inline))
...@@ -55,12 +55,27 @@ main(int argc, char const *argv[]) ...@@ -55,12 +55,27 @@ main(int argc, char const *argv[])
return 0; return 0;
} }
// CHECK: DW_TAG_inlined_subroutine // CHECK: define i32 @_Z3fooii(i32 %i, i32 %j)
// CHECK: DW_TAG_inlined_subroutine // i
// CHECK: DW_TAG_inlined_subroutine // CHECK: call void @llvm.dbg.declare
// CHECK: DW_TAG_inlined_subroutine // j
// CHECK-NOT: DW_TAG_inlined_subroutine // CHECK: call void @llvm.dbg.declare
// CHECK: DW_AT_call_line {{.*}} (0x2a) // x
// CHECK: DW_TAG_inlined_subroutine // CHECK: call void @llvm.dbg.declare
// CHECK-NOT: DW_TAG_inlined_subroutine // y
// CHECK: DW_AT_call_line {{.*}} (0x2a) // CHECK: call void @llvm.dbg.declare
// result
// CHECK: call void @llvm.dbg.declare
// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[A_MD:[0-9]+]]), !dbg ![[A_DI:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[B_MD:[0-9]+]]), !dbg ![[B_DI:[0-9]+]]
// result
// CHECK: call void @llvm.dbg.declare
// We want to see a distinct !dbg node.
// CHECK-NOT: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[A_MD]]), !dbg ![[A_DI]]
// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[A_MD]]), !dbg !{{.*}}
// CHECK-NOT: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[B_MD]]), !dbg ![[B_DI]]
// CHECK: call void @llvm.dbg.declare(metadata !{i32* %{{.*}}}, metadata ![[B_MD]]), !dbg !{{.*}}
// result
// CHECK: call void @llvm.dbg.declare
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment