diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-02-27 20:26:13 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-02-27 20:26:13 +0000 |
commit | fce4715bc343bf788c3767e16f1492b96ef73b8e (patch) | |
tree | de8c2b6d82b7c90fd35d2fb10187ca60dbbba0ba | |
parent | d411a4b23077b29e19c9371bbb19b054a374d922 (diff) |
Add missing code for compound literals of complex type. <rdar://problem/10938628>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151549 91177308-0d34-0410-b5e6-96231b3b80d8
-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 } |