From fc1a75b77c491f243e3c5de96fdff6394f5a82ee Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Thu, 3 Oct 2013 14:23:28 +0000 Subject: [PATCH] ARM: *-*-darwin-eabi triples should use AAPCS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191900 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 3 ++- test/Driver/darwin-eabi.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/Driver/darwin-eabi.c diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ff50169e44..2f824cbcad 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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 index 0000000000..c264989438 --- /dev/null +++ b/test/Driver/darwin-eabi.c @@ -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" -- 2.40.0