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 | afa84ae85b260f66b0894fb4441ac3e8b5aa247c (patch) | |
| tree | 24ce8ca1133a5d7015c5e9bc9ad1131cf9b0d578 | |
| parent | 91d0098dc81c34f309aba499c74f839d03b937b2 (diff) | |
| download | bcm5719-llvm-afa84ae85b260f66b0894fb4441ac3e8b5aa247c.tar.gz bcm5719-llvm-afa84ae85b260f66b0894fb4441ac3e8b5aa247c.zip | |
Add missing code for compound literals of complex type. <rdar://problem/10938628>
llvm-svn: 151549
| -rw-r--r-- | clang/lib/CodeGen/CGExprComplex.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGen/complex-init-list.c | 8 |
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 } |

