]> granicus.if.org Git - clang/commitdiff
Isolate test for PR22096 to clang.
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 16 Jan 2015 22:55:09 +0000 (22:55 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 16 Jan 2015 22:55:09 +0000 (22:55 +0000)
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)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226337 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/crash.cpp
test/CodeGenCXX/debug-info-line.cpp

index e1577a3abe37556019ef7a4c23f65c1ef8216ad0..256291ade736cf9bd7377ef10f1ff94035ee19ec 100644 (file)
@@ -34,13 +34,3 @@ template <class ELFT> void finalizeDefaultAtomValues() {
 
 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;
-}
index a5cc6392b4fcf67b6e87ad7ae19d3f83e8b1568d..02b5059c5d3b9889c37d716a6cacb4dc60135dbf 100644 (file)
@@ -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,