diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-01-16 22:55:09 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-01-16 22:55:09 +0000 |
commit | 71fb83ea7aeed1a60a621752471f9f7f28346df3 (patch) | |
tree | a92e116135317d2d24ad9056bb382ba8547e9155 | |
parent | 3a8d7e2f10f9395f738db8ff19c9e38ede1097c8 (diff) | |
download | bcm5719-llvm-71fb83ea7aeed1a60a621752471f9f7f28346df3.tar.gz bcm5719-llvm-71fb83ea7aeed1a60a621752471f9f7f28346df3.zip |
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
-rw-r--r-- | clang/test/CodeGenCXX/crash.cpp | 10 | ||||
-rw-r--r-- | 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 e1577a3abe3..256291ade73 100644 --- a/clang/test/CodeGenCXX/crash.cpp +++ b/clang/test/CodeGenCXX/crash.cpp @@ -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; -} diff --git a/clang/test/CodeGenCXX/debug-info-line.cpp b/clang/test/CodeGenCXX/debug-info-line.cpp index a5cc6392b4f..02b5059c5d3 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, |