ComplexPairTy ComplexExprEmitter::VisitCallExpr(const CallExpr *E) {
+ if (E->getCallReturnType()->isReferenceType())
+ return EmitLoadOfLValue(E);
+
return CGF.EmitCallExpr(E).getComplexVal();
}
Value *EmitCastExpr(const Expr *E, QualType T);
Value *VisitCallExpr(const CallExpr *E) {
+ if (E->getCallReturnType()->isReferenceType())
+ return EmitLoadOfLValue(E);
+
return CGF.EmitCallExpr(E).getScalarVal();
}
f(true);
bool_reference_return() = true;
+ a = bool_reference_return();
}
void test_scalar() {
f((vec4){1,2,3,4}[0]);
int_reference_return() = 10;
+ a = int_reference_return();
}
void test_complex() {
f(10i);
complex_int_reference_return() = 10i;
+ a = complex_int_reference_return();
}
void test_aggregate() {