From: Akira Hatanaka Date: Mon, 24 Aug 2015 19:50:35 +0000 (+0000) Subject: [ARM] Error out on apple darwin platforms if float-abi is "hard". X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e35de8288ea2f88f9ae1027f7d3449d38dacd45e;p=clang [ARM] Error out on apple darwin platforms if float-abi is "hard". Error out if the user tries to use float-abi="hard" since it isn't supported on darwin platforms. Previously clang issued no warnings or erros and just passed the option to the backend, which had no effect on code generation for targets using apcs. rdar://problem/22257950 Differential Revision: http://reviews.llvm.org/D12155 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245866 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ba5dad5466..6bc57f724f 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -582,6 +582,10 @@ StringRef tools::arm::getARMFloatABI(const Driver &D, const ArgList &Args, FloatABI = "soft"; } } + + if (Triple.isOSDarwin() && FloatABI == "hard") + D.Diag(diag::err_drv_unsupported_opt_for_target) << A->getAsString(Args) + << Triple.getArchName(); } // If unspecified, choose the default based on the platform. diff --git a/test/Driver/arm-float-abi.c b/test/Driver/arm-float-abi.c new file mode 100644 index 0000000000..5b8130bb10 --- /dev/null +++ b/test/Driver/arm-float-abi.c @@ -0,0 +1,5 @@ +// RUN: not %clang %s -target armv7-apple-ios -mfloat-abi=hard 2>&1 | FileCheck -check-prefix=ARMV7-HARD %s +// RUN: %clang %s -target armv7-apple-ios -mfloat-abi=softfp -### 2>&1 | FileCheck -check-prefix=ARMV7-SOFTFP %s + +// ARMV7-HARD: unsupported option '-mfloat-abi=hard' for target 'thumbv7' +// ARMV7-SOFTFP-NOT: unsupported option