if (Ty->getAs<BuiltinType>() || Ty->isPointerType())
return true;
- // Complex types "should" be ok by the definition above, but they are not.
- if (Ty->isAnyComplexType())
- return false;
+ // Small complex integer types are "integer like".
+ if (const ComplexType *CT = Ty->getAs<ComplexType>())
+ return isIntegerLikeType(CT->getElementType(), Context, VMContext);
// Single element and zero sized arrays should be allowed, by the definition
// above, but they are not.
_Complex long long f25(void) {}
_Complex float f26(void) {}
_Complex double f27(void) {}
+
+// APCS-GNU: define arm_apcscc i16 @f28()
+// AAPCS: define arm_aapcscc i16 @f28()
+struct s28 { _Complex char f0; };
+struct s28 f28() {}
+
+// APCS-GNU: define arm_apcscc i32 @f29()
+// AAPCS: define arm_aapcscc i32 @f29()
+struct s29 { _Complex short f0; };
+struct s29 f29() {}
+
+// APCS-GNU: define arm_apcscc void @f30({{.*}} noalias sret
+// AAPCS: define arm_aapcscc void @f30({{.*}} noalias sret
+struct s30 { _Complex int f0; };
+struct s30 f30() {}