summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp4
-rw-r--r--clang/test/CodeGen/complex-init-list.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index ae192cb8365..d2a760054b5 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -261,6 +261,10 @@ public:
ComplexPairTy VisitInitListExpr(InitListExpr *E);
+ ComplexPairTy VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
+ return EmitLoadOfLValue(E);
+ }
+
ComplexPairTy VisitVAArgExpr(VAArgExpr *E);
ComplexPairTy VisitAtomicExpr(AtomicExpr *E) {
diff --git a/clang/test/CodeGen/complex-init-list.c b/clang/test/CodeGen/complex-init-list.c
index 819d4f9432d..99c1c62b588 100644
--- a/clang/test/CodeGen/complex-init-list.c
+++ b/clang/test/CodeGen/complex-init-list.c
@@ -9,4 +9,10 @@ _Complex float x = { 1.0f, 1.0f/0.0f };
_Complex float f(float x, float y) { _Complex float z = { x, y }; return z; }
// CHECK: define <2 x float> @f
-// CHECK: alloca { float, float } \ No newline at end of file
+// CHECK: alloca { float, float }
+// CHECK: alloca { float, float }
+
+_Complex float f2(float x, float y) { return (_Complex float){ x, y }; }
+// CHECK: define <2 x float> @f2
+// CHECK: alloca { float, float }
+// CHECK: alloca { float, float }
OpenPOWER on IntegriCloud