diff options
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 5 | ||||
-rw-r--r-- | clang/test/Driver/arm-mfpu.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 5087ce6816c..9e71c31c623 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -718,8 +718,11 @@ static void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, // Setting -msoft-float effectively disables NEON because of the GCC // implementation, although the same isn't true of VFP or VFP3. - if (FloatABI == "soft") + if (FloatABI == "soft") { Features.push_back("-neon"); + // Also need to explicitly disable features which imply NEON. + Features.push_back("-crypto"); + } // En/disable crc if (Arg *A = Args.getLastArg(options::OPT_mcrc, diff --git a/clang/test/Driver/arm-mfpu.c b/clang/test/Driver/arm-mfpu.c index 020605b377a..0f9d99593da 100644 --- a/clang/test/Driver/arm-mfpu.c +++ b/clang/test/Driver/arm-mfpu.c @@ -63,11 +63,16 @@ // RUN: | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s // CHECK-SOFT-FLOAT: "-target-feature" "-neon" +// RUN: %clang -target armv8 %s -### 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARMV8-DEFAULT-SOFT-FP %s +// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-neon" +// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-crypto" + // RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8" -// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto" // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon" +// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto" // RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-FP-ARMV8 %s |