summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp1
-rw-r--r--clang/test/CodeGenCXX/debug-info-line.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 1580bbe6a29..2cbd42b7ee5 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -95,6 +95,7 @@ public:
//===--------------------------------------------------------------------===//
ComplexPairTy Visit(Expr *E) {
+ ApplyDebugLocation DL(CGF, E->getLocStart());
return StmtVisitor<ComplexExprEmitter, ComplexPairTy>::Visit(E);
}
diff --git a/clang/test/CodeGenCXX/debug-info-line.cpp b/clang/test/CodeGenCXX/debug-info-line.cpp
index 8278b1d53f7..36b7a94a514 100644
--- a/clang/test/CodeGenCXX/debug-info-line.cpp
+++ b/clang/test/CodeGenCXX/debug-info-line.cpp
@@ -182,6 +182,7 @@ struct f14_use {
f14_use::f14_use() = default;
// CHECK-LABEL: define
+// CHECK-LABEL: define
void func(foo);
void f15(foo *f) {
func(
@@ -190,6 +191,14 @@ void f15(foo *f) {
f[3]);
}
+// CHECK-LABEL: define
+void f16(__complex float f) {
+ __complex float g = //
+// CHECK: add {{.*}}, !dbg [[DBG_F16:![0-9]*]]
+#line 1800
+ f + 1;
+}
+
// CHECK: [[DBG_F1]] = !MDLocation(line: 100,
// CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
// CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,
@@ -211,3 +220,4 @@ void f15(foo *f) {
// CHECK: [[DBG_F13]] = !MDLocation(line: 1500,
// CHECK: [[DBG_F14_CTOR_CALL]] = !MDLocation(line: 1600,
// CHECK: [[DBG_F15]] = !MDLocation(line: 1700,
+// CHECK: [[DBG_F16]] = !MDLocation(line: 1800,
OpenPOWER on IntegriCloud