From 8b409a087719f7c6b1a23b1d05a6237a145c241d Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Thu, 22 May 2014 12:54:30 +0000 Subject: [PATCH] MachO: perform ARM ABI detection even for non-Darwin triples. 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 | 2 +- test/Driver/macho-embedded.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 534afc5a0d..e51cb1b279 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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 || diff --git a/test/Driver/macho-embedded.c b/test/Driver/macho-embedded.c index e45547db9e..cde157d8b4 100644 --- a/test/Driver/macho-embedded.c +++ b/test/Driver/macho-embedded.c @@ -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 -- 2.40.0