r226337 - Isolate test for PR22096 to clang.

David Blaikie dblaikie at gmail.com
Fri Jan 16 14:55:10 PST 2015


Author: dblaikie
Date: Fri Jan 16 16:55:09 2015
New Revision: 226337

URL: http://llvm.org/viewvc/llvm-project?rev=226337&view=rev
Log:
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)

Modified:
    cfe/trunk/test/CodeGenCXX/crash.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-line.cpp

Modified: cfe/trunk/test/CodeGenCXX/crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/crash.cpp?rev=226337&r1=226336&r2=226337&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/crash.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/crash.cpp Fri Jan 16 16:55:09 2015
@@ -34,13 +34,3 @@ template <class ELFT> void finalizeDefau
 
 void f() { finalizeDefaultAtomValues<int>(); }
 }
-
-namespace PR22096 {
-template <class> struct c {
-  c();
-  template <class U> __attribute__((__always_inline__)) c(c<U>) {}
-};
-struct {
-  c<double> v = c<int>();
-} o;
-}

Modified: cfe/trunk/test/CodeGenCXX/debug-info-line.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-line.cpp?rev=226337&r1=226336&r2=226337&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Fri Jan 16 16:55:09 2015
@@ -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,





More information about the cfe-commits mailing list