]> granicus.if.org Git - clang/commitdiff
MachO: perform ARM ABI detection even for non-Darwin triples.
authorTim Northover <tnorthover@apple.com>
Thu, 22 May 2014 12:54:30 +0000 (12:54 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 22 May 2014 12:54:30 +0000 (12:54 +0000)
When "-arch armv7m" is specified, we want "aapcs", for example.

rdar://problem/16581138

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

lib/Driver/Tools.cpp
test/Driver/macho-embedded.c

index 534afc5a0d5a4f58974b5d70ec2d8e54fa4dda25..e51cb1b27957010c53ee14fa315adf8da739635b 100644 (file)
@@ -771,7 +771,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
   const char *ABIName = nullptr;
   if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
     ABIName = A->getValue();
-  } else if (Triple.isOSDarwin()) {
+  } else if (Triple.isOSBinFormatMachO()) {
     // The backend is hardwired to assume AAPCS for M-class processors, ensure
     // the frontend matches that.
     if (Triple.getEnvironment() == llvm::Triple::EABI ||
index e45547db9e298334278ae556a157148560eb9cbd..cde157d8b4d4bd80842a8002cec8e325e1fab2a2 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang -arch armv7 -target thumbv7-apple-darwin-eabi -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
+// RUN: %clang -target x86_64-apple-macosx10.9 -arch armv7m -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-AAPCS
 // RUN: %clang -arch armv7s -target thumbv7-apple-ios -### -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
 // RUN: %clang -arch armv6m -target thumbv7-apple-darwin -### -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACHO-EMBEDDED