From 71fb83ea7aeed1a60a621752471f9f7f28346df3 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 16 Jan 2015 22:55:09 +0000 Subject: [PATCH] Isolate test for PR22096 to clang. Emitting inlinable calls without debug locations (in functions with debug info, to functions with debug info) is problematic for debug info when inlining occurs. Test specifically that we don't do that in this case - thus the test isn't simply "don't crash", it's "include debug location for this call" (granted it's the wrong location - fix for that is coming) llvm-svn: 226337 --- clang/test/CodeGenCXX/crash.cpp | 10 --------- clang/test/CodeGenCXX/debug-info-line.cpp | 36 +++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/clang/test/CodeGenCXX/crash.cpp b/clang/test/CodeGenCXX/crash.cpp index e1577a3..256291a 100644 --- a/clang/test/CodeGenCXX/crash.cpp +++ b/clang/test/CodeGenCXX/crash.cpp @@ -34,13 +34,3 @@ template void finalizeDefaultAtomValues() { void f() { finalizeDefaultAtomValues(); } } - -namespace PR22096 { -template struct c { - c(); - template __attribute__((__always_inline__)) c(c) {} -}; -struct { - c v = c(); -} o; -} diff --git a/clang/test/CodeGenCXX/debug-info-line.cpp b/clang/test/CodeGenCXX/debug-info-line.cpp index a5cc639..02b5059 100644 --- a/clang/test/CodeGenCXX/debug-info-line.cpp +++ b/clang/test/CodeGenCXX/debug-info-line.cpp @@ -135,7 +135,7 @@ struct bar { // CHECK: invoke{{ }} // CHECK: invoke{{ }} // CHECK: to label {{.*}}, !dbg [[DBG_GLBL_DTOR_B:!.*]] -#line 1500 +#line 1200 bar b[1] = { // (fn(), // bar())}; @@ -144,7 +144,7 @@ bar b[1] = { // __complex double f11() { __complex double f; // CHECK: store {{.*}} !dbg [[DBG_F11:!.*]] -#line 1200 +#line 1300 return f; } @@ -153,7 +153,7 @@ void f12() { int f12_1(); void f12_2(int = f12_1()); // CHECK: call {{(signext )?}}i32 {{.*}} !dbg [[DBG_F12:!.*]] -#line 1300 +#line 1400 f12_2(); } @@ -162,10 +162,27 @@ void f13() { // CHECK: call {{.*}} !dbg [[DBG_F13:!.*]] #define F13_IMPL 1, src() 1, -#line 1400 +#line 1500 F13_IMPL; } +struct f14 { + f14(int); +}; + +// CHECK-LABEL: define +// CHECK-LABEL: define +// CHECK-LABEL: define +// CHECK: call {{.*}}, !dbg [[DBG_F14_CTOR_CALL:![0-9]*]] +// FIXME: The ctor call should be attributed to the line of the NSDMI, not the +// start of this declaration. +#line 1600 +struct { + f14 v = 1; +} f14_inst; + +// CHECK-LABEL: define + // CHECK: [[DBG_F1]] = !MDLocation(line: 100, // CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200, // CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202, @@ -180,8 +197,9 @@ void f13() { // CHECK: [[DBG_F9]] = !MDLocation(line: 1000, // CHECK: [[DBG_F10_ICMP]] = !MDLocation(line: 1100, // CHECK: [[DBG_F10_STORE]] = !MDLocation(line: 1100, -// CHECK: [[DBG_GLBL_CTOR_B]] = !MDLocation(line: 1500, -// CHECK: [[DBG_GLBL_DTOR_B]] = !MDLocation(line: 1500, -// CHECK: [[DBG_F11]] = !MDLocation(line: 1200, -// CHECK: [[DBG_F12]] = !MDLocation(line: 1300, -// CHECK: [[DBG_F13]] = !MDLocation(line: 1400, +// CHECK: [[DBG_GLBL_CTOR_B]] = !MDLocation(line: 1200, +// CHECK: [[DBG_GLBL_DTOR_B]] = !MDLocation(line: 1200, +// CHECK: [[DBG_F11]] = !MDLocation(line: 1300, +// CHECK: [[DBG_F12]] = !MDLocation(line: 1400, +// CHECK: [[DBG_F13]] = !MDLocation(line: 1500, +// CHECK: [[DBG_F14_CTOR_CALL]] = !MDLocation(line: 1600, -- 2.7.4