diff options
| author | Adrian Prantl <aprantl@apple.com> | 2013-03-12 21:40:00 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2013-03-12 21:40:00 +0000 |
| commit | 06e5e15ba459ad6488fb61fd8f5ce838abb39b93 (patch) | |
| tree | a717e5c511c15de36d22d3ef0e6c9c1b53e7ee1f /clang/test/CodeGenCXX/debug-info-same-line.cpp | |
| parent | 7f54714dcc4418a14da694447c950badb7dff481 (diff) | |
| download | bcm5719-llvm-06e5e15ba459ad6488fb61fd8f5ce838abb39b93.tar.gz bcm5719-llvm-06e5e15ba459ad6488fb61fd8f5ce838abb39b93.zip | |
Eliminate backend dependency in CFE testcase.
llvm-svn: 176901
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-same-line.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-same-line.cpp | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-same-line.cpp b/clang/test/CodeGenCXX/debug-info-same-line.cpp index 6658c883db0..be7c4d86781 100644 --- a/clang/test/CodeGenCXX/debug-info-same-line.cpp +++ b/clang/test/CodeGenCXX/debug-info-same-line.cpp @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -g -emit-obj -o %t %s -// RUN: llvm-dwarfdump %t | FileCheck %s -// In the attached test case a post-r166236 clang coalesces two -// instances of an inlined function in a way that makes it appear as -// if the function was only inlined once. +// RUN: %clang_cc1 -g -emit-llvm -o - %s | FileCheck %s + +// Make sure that clang outputs distinct debug info for a function +// that is inlined twice on the same line. Otherwise it would appear +// as if the function was only inlined once. #define INLINE inline __attribute__((always_inline)) @@ -55,12 +55,27 @@ main(int argc, char const *argv[]) return 0; } -// CHECK: DW_TAG_inlined_subroutine -// CHECK: DW_TAG_inlined_subroutine -// CHECK: DW_TAG_inlined_subroutine -// CHECK: DW_TAG_inlined_subroutine -// CHECK-NOT: DW_TAG_inlined_subroutine -// CHECK: DW_AT_call_line {{.*}} (0x2a) -// CHECK: DW_TAG_inlined_subroutine -// CHECK-NOT: DW_TAG_inlined_subroutine -// CHECK: DW_AT_call_line {{.*}} (0x2a) +// CHECK: define i32 @_Z3fooii(i32 %i, i32 %j) +// i +// CHECK: call void @llvm.dbg.declare +// j +// CHECK: call void @llvm.dbg.declare +// x +// CHECK: call void @llvm.dbg.declare +// y +// 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 |

