ARM: make Darwin's "-arch armv7em" default to hard-float.

We've already paid the price for separate "armv7m" and "armv7em" slices
(support in other tools), it's silly to make them identical other than the
default CPU.

rdar://23055688

llvm-svn: 266211
This commit is contained in:
Tim Northover 2016-04-13 17:08:51 +00:00
parent c05b767df1
commit 99694feca5
2 changed files with 15 additions and 9 deletions

View File

@ -803,7 +803,12 @@ arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {
break;
default:
// Assume "soft", but warn the user we are guessing.
ABI = FloatABI::Soft;
if (Triple.isOSBinFormatMachO() &&
Triple.getSubArch() == llvm::Triple::ARMSubArch_v7em)
ABI = FloatABI::Hard;
else
ABI = FloatABI::Soft;
if (Triple.getOS() != llvm::Triple::UnknownOS ||
!Triple.isOSBinFormatMachO())
D.Diag(diag::warn_drv_assuming_mfloat_abi_is) << "soft";

View File

@ -1,6 +1,6 @@
// RUN: %clang -target x86_64-apple-darwin -arch armv6m -resource-dir=%S/Inputs/resource_dir %s -### 2> %t
// RUN: %clang -target x86_64-apple-darwin -arch armv7em -resource-dir=%S/Inputs/resource_dir %s -### 2>> %t
// RUN: %clang -target x86_64-apple-darwin -arch armv7em -mhard-float -resource-dir=%S/Inputs/resource_dir %s -### 2>> %t
// RUN: %clang -target x86_64-apple-darwin -arch armv7em -mfloat-abi=soft -resource-dir=%S/Inputs/resource_dir %s -### 2>> %t
// RUN: %clang -target x86_64-apple-darwin -arch armv7m -fPIC -resource-dir=%S/Inputs/resource_dir %s -### 2>> %t
// RUN: %clang -target x86_64-apple-darwin -arch armv7em -fPIC -mfloat-abi=hard -resource-dir=%S/Inputs/resource_dir %s -### 2>> %t
@ -17,18 +17,19 @@
// CHECK: "-mfloat-abi" "soft"
// CHECK: libclang_rt.soft_static.a
// ARMv7em does, but defaults to soft
// CHECK-LABEL: Target:
// CHECK-NOT: warning: unknown platform
// CHECK: "-mfloat-abi" "soft"
// CHECK: libclang_rt.soft_static.a
// Which can be overridden
// ARMv7em does
// CHECK-LABEL: Target:
// CHECK-NOT: warning: unknown platform
// CHECK: "-mfloat-abi" "hard"
// CHECK: libclang_rt.hard_static.a
// but the ABI can be overridden
// CHECK-LABEL: Target:
// CHECK-NOT: warning: unknown platform
// CHECK: "-target-feature" "+soft-float"
// CHECK: "-mfloat-abi" "soft"
// CHECK: libclang_rt.soft_static.a
// ARMv7m has no float either
// CHECK-LABEL: Target:
// CHECK-NOT: warning: unknown platform