ARM: *-*-darwin-eabi triples should use AAPCS.

llvm-svn: 191900
This commit is contained in:
Tim Northover 2013-10-03 14:23:28 +00:00
parent 83ebd022d7
commit e66c946ee4
2 changed files with 9 additions and 1 deletions

View 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";

View File

@ -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"