diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp b/clang/lib/Driver/ToolChains/Arch/ARM.cpp index b6b1c2e28a96c..5f58d42061e0a 100644 --- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp +++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp @@ -795,7 +795,7 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D, HasSimd = ItSimd->starts_with("+"); if (!HasSimd && FPUSupportsNeon) Features.insert(Features.end(), - {"-sha2", "-aes", "-crypto", "-dotprod", "-bf16", "-imm8"}); + {"-sha2", "-aes", "-crypto", "-dotprod", "-bf16", "-i8mm"}); // For Arch >= ARMv8.0 && A or R profile: crypto = sha2 + aes // Rather than replace within the feature vector, determine whether each diff --git a/clang/test/Driver/arm-features.c b/clang/test/Driver/arm-features.c index 830bd54198e99..18e0525aa6235 100644 --- a/clang/test/Driver/arm-features.c +++ b/clang/test/Driver/arm-features.c @@ -105,3 +105,13 @@ // RUN: %clang -target arm-none-none-eabi -march=armv8-r+bf16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEON-ENABLED-WITH-FEATURE %s // RUN: %clang -target arm-none-none-eabi -march=armv8-r+i8mm -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEON-ENABLED-WITH-FEATURE %s // CHECK-NEON-ENABLED-WITH-FEATURE: "-target-feature" "+neon" + +// Check that disabling NEON disables all features associated with this +// RUN: %clang -target arm-none-none-eabi -march=armv8-a+nosimd -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES %s +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-neon" +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-dotprod" +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-bf16" +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-i8mm" +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-crypto" +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-sha2" +// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-aes"