diff options
-rw-r--r-- | lib/CodeGen/CGExprComplex.cpp | 4 | ||||
-rw-r--r-- | test/CodeGen/complex-init-list.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index ae192cb836..d2a760054b 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/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/test/CodeGen/complex-init-list.c b/test/CodeGen/complex-init-list.c index 819d4f9432..99c1c62b58 100644 --- a/test/CodeGen/complex-init-list.c +++ b/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 } |