Index: lib/Basic/Targets/ARM.cpp =================================================================== --- lib/Basic/Targets/ARM.cpp +++ lib/Basic/Targets/ARM.cpp @@ -661,7 +661,7 @@ } // ACLE 6.4.9 32-bit SIMD instructions - if (ArchVersion >= 6 && (CPUProfile != "M" || CPUAttr == "7EM")) + if ((ArchVersion >= 6 && DSP)) Builder.defineMacro("__ARM_FEATURE_SIMD32", "1"); // ACLE 6.4.10 Hardware Integer Divide Index: test/Preprocessor/arm-acle-6.4.c =================================================================== --- test/Preprocessor/arm-acle-6.4.c +++ test/Preprocessor/arm-acle-6.4.c @@ -174,10 +174,14 @@ // CHECK-V7M: __ARM_FEATURE_SAT 1 // CHECK-V7M: __ARM_FEATURE_UNALIGNED 1 -// RUN: %clang -target arm-none-linux-eabi -march=armv7e-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V7EM - -// CHECK-V7EM: __ARM_FEATURE_DSP 1 -// CHECK-V7EM: __ARM_FEATURE_SIMD32 1 +// RUN: %clang -target arm-none-linux-eabi -march=armv7e-m -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP +// RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP +// RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m7 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP +// RUN: %clang --target=arm-arm-none-eabi -mcpu=cortex-m33 -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP +// RUN: %clang --target=arm-arm-none-eabi -march=armv8m.main+dsp -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-M-DSP + +// CHECK-M-DSP: __ARM_FEATURE_DSP 1 +// CHECK-M-DSP: __ARM_FEATURE_SIMD32 1 // RUN: %clang -target arm-none-linux-eabi -march=armv8-a -x c -E -dM %s -o - | FileCheck %s -check-prefix CHECK-V8A