]> granicus.if.org Git - clang/commitdiff
ARM: *-*-darwin-eabi triples should use AAPCS.
authorTim Northover <tnorthover@apple.com>
Thu, 3 Oct 2013 14:23:28 +0000 (14:23 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 3 Oct 2013 14:23:28 +0000 (14:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191900 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/darwin-eabi.c [new file with mode: 0644]

index ff50169e44fd1b97b2e4f1e12833f4eb0b581785..2f824cbcad77a99244819de016c78336a79e83e7 100644 (file)
@@ -765,7 +765,8 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
   } else if (Triple.isOSDarwin()) {
     // The backend is hardwired to assume AAPCS for M-class processors, ensure
     // the frontend matches that.
-    if (StringRef(CPUName).startswith("cortex-m")) {
+    if (Triple.getEnvironment() == llvm::Triple::EABI ||
+        StringRef(CPUName).startswith("cortex-m")) {
       ABIName = "aapcs";
     } else {
       ABIName = "apcs-gnu";
diff --git a/test/Driver/darwin-eabi.c b/test/Driver/darwin-eabi.c
new file mode 100644 (file)
index 0000000..c264989
--- /dev/null
@@ -0,0 +1,7 @@
+// RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
+// RUN: %clang -arch armv7 -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
+// RUN: %clang -arch armv7s -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
+// RUN: %clang -arch armv7s -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-APCS
+
+// CHECK-AAPCS: "-target-abi" "aapcs"
+// CHECK-APCS: "-target-abi" "apcs-gnu"