Add missing code for compound literals of complex type. <rdar://problem/10938628>

llvm-svn: 151549
This commit is contained in:
Eli Friedman 2012-02-27 20:26:13 +00:00
parent 91d0098dc8
commit afa84ae85b
2 changed files with 11 additions and 1 deletions

View File

@ -261,6 +261,10 @@ public:
ComplexPairTy VisitInitListExpr(InitListExpr *E);
ComplexPairTy VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
return EmitLoadOfLValue(E);
}
ComplexPairTy VisitVAArgExpr(VAArgExpr *E);
ComplexPairTy VisitAtomicExpr(AtomicExpr *E) {

View File

@ -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 }
// 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 }