]> granicus.if.org Git - clang/commitdiff
ARM64: make sure the caller is expected to extend in AAPCS.
authorTim Northover <tnorthover@apple.com>
Fri, 18 Apr 2014 13:46:08 +0000 (13:46 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 18 Apr 2014 13:46:08 +0000 (13:46 +0000)
This is one of those DarwinPCS differences. It'd been caught in
arguments, but not return values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206594 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp
test/CodeGen/arm64-aapcs-arguments.c

index 47c5269ec5a54b956e15f914c918cb591f1f24a1..246f238e65822af8cfcdb59d02b0030d900c884d 100644 (file)
@@ -3368,8 +3368,9 @@ ABIArgInfo ARM64ABIInfo::classifyReturnType(QualType RetTy) const {
     if (const EnumType *EnumTy = RetTy->getAs<EnumType>())
       RetTy = EnumTy->getDecl()->getIntegerType();
 
-    return (RetTy->isPromotableIntegerType() ? ABIArgInfo::getExtend()
-                                             : ABIArgInfo::getDirect());
+    return (RetTy->isPromotableIntegerType() && isDarwinPCS()
+                ? ABIArgInfo::getExtend()
+                : ABIArgInfo::getDirect());
   }
 
   // Structures with either a non-trivial destructor or a non-trivial
index 72527b5acfb9589ec9ff13cfe701716041edcd90..b430630b0711be45038808efd8a0151736feeb69 100644 (file)
@@ -33,3 +33,10 @@ typedef __attribute__((neon_vector_type(16))) signed char int8x16_t;
 typedef struct { int8x16_t arr[3]; } BigHFA;
 void test4(BigHFA v0_v2, BigHFA v3_v5, BigHFA sp, double sp48, BigHFA sp64) {
 }
+
+// It's the job of the argument *consumer* to perform the required sign & zero
+// extensions under AAPCS. There shouldn't be
+
+// CHECK: define i8 @test5(i8 %a, i16 %b)
+unsigned char test5(unsigned char a, signed short b) {
+}