diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp b/clang/lib/Driver/ToolChains/Arch/ARM.cpp index b8181ce6dc012..2fb16d2e41320 100644 --- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp +++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp @@ -647,7 +647,7 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D, (void)getARMFPUFeatures(D, WaFPU->first, Args, WaFPU->second, Features); } else if (FPUArg) { FPUKind = getARMFPUFeatures(D, FPUArg, Args, FPUArg->getValue(), Features); - } else if (Triple.isAndroid() && getARMSubArchVersionNumber(Triple) >= 7) { + } else if (Triple.isAndroid() && getARMSubArchVersionNumber(Triple) == 7) { const char *AndroidFPU = "neon"; FPUKind = llvm::ARM::parseFPU(AndroidFPU); if (!llvm::ARM::getFPUFeatures(FPUKind, Features)) diff --git a/clang/test/Driver/arm-mfpu.c b/clang/test/Driver/arm-mfpu.c index 1b174be388124..babfa16741ad7 100644 --- a/clang/test/Driver/arm-mfpu.c +++ b/clang/test/Driver/arm-mfpu.c @@ -409,6 +409,25 @@ // CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+sha2" // CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+aes" +// RUN: %clang -target armv8-linux-androideabi21 %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM8-ANDROID-FP-DEFAULT %s +// CHECK-ARM8-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+soft-float-abi" +// CHECK-ARM8-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+vfp3" +// CHECK-ARM8-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+vfp4" +// CHECK-ARM8-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+fp-armv8" +// CHECK-ARM8-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+aes" +// CHECK-ARM8-ANDROID-FP-DEFAULT-DAG: "-target-feature" "+sha2" +// CHECK-ARM8-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+neon" + +// RUN: %clang -target armv8-linux-android %s -### -c 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-ARM8-ANDROID-DEFAULT %s +// CHECK-ARM8-ANDROID-DEFAULT-DAG: "-target-feature" "+vfp3" +// CHECK-ARM8-ANDROID-DEFAULT-DAG: "-target-feature" "+vfp4" +// CHECK-ARM8-ANDROID-DEFAULT-DAG: "-target-feature" "+fp-armv8" +// CHECK-ARM8-ANDROID-DEFAULT-DAG: "-target-feature" "+aes" +// CHECK-ARM8-ANDROID-DEFAULT-DAG: "-target-feature" "+sha2" +// CHECK-ARM8-ANDROID-DEFAULT-NOT: "-target-feature" "+neon" + // RUN: %clang -target armv7-linux-androideabi21 %s -mfpu=vfp3-d16 -### -c 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-ARM7-ANDROID-FP-D16 %s // CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+soft-float"