aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-14 02:20:34 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-14 02:20:34 +0000
commitb0d58196808aba4b3d1a7488bd5566f3c0a83e89 (patch)
tree6fab521759d0dafecb2fa9494c3eb4d02fdd9e29
parent76e2b710a92bceb9575a81db181109664946986e (diff)
ARM/APCS: Don't treat structs w/ floating point types as "integer like".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81748 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/TargetABIInfo.cpp4
-rw-r--r--test/CodeGen/arm-arguments.c14
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetABIInfo.cpp b/lib/CodeGen/TargetABIInfo.cpp
index 1dd88bb481..c403960580 100644
--- a/lib/CodeGen/TargetABIInfo.cpp
+++ b/lib/CodeGen/TargetABIInfo.cpp
@@ -1430,6 +1430,10 @@ static bool isIntegerLikeType(QualType Ty,
if (Ty->isVectorType())
return false;
+ // Float types are never treated as "integer like".
+ if (Ty->isRealFloatingType())
+ return false;
+
// If this is a builtin or pointer type then it is ok.
if (Ty->getAsBuiltinType() || Ty->isPointerType())
return true;
diff --git a/test/CodeGen/arm-arguments.c b/test/CodeGen/arm-arguments.c
index 0448f92aa4..e58d2fddef 100644
--- a/test/CodeGen/arm-arguments.c
+++ b/test/CodeGen/arm-arguments.c
@@ -70,3 +70,17 @@ struct s11 f11(void) {}
// AAPCS: define arm_aapcscc i32 @f12()
union u12 { char f0; short f1; int f2; };
union u12 f12(void) {}
+
+// APCS-GNU: define arm_apcscc void @f13(
+// APCS-GNU: struct.s13* noalias sret
+
+// FIXME: This should return a float.
+// AAPCS-FIXME: define arm_aapcscc float @f13()
+struct s13 { float f0; };
+struct s13 f13(void) {}
+
+// APCS-GNU: define arm_apcscc void @f14(
+// APCS-GNU: struct.s13* noalias sret
+// AAPCS: define arm_aapcscc i32 @f14()
+union u14 { float f0; };
+union u14 f14(void) {}