[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / arm-cmse-cve-2021-35465.c
blob8a28085dbd17eeb6a3410c1af0cea4d0ac7e3d58
1 // Disable the fix
2 //
3 // RUN: %clang --target=arm-arm-none-eabi -march=armv8-m.main %s -### \
4 // RUN: -mcmse -mno-fix-cmse-cve-2021-35465 2>&1 |\
5 // RUN: FileCheck %s --check-prefix=CHECK-NOFIX
6 //
7 // RUN: %clang --target=arm-arm-none-eabi -march=armv8.1-m.main %s -### \
8 // RUN: -mcmse -mno-fix-cmse-cve-2021-35465 2>&1 |\
9 // RUN: FileCheck %s --check-prefix=CHECK-NOFIX
11 // RUN: %clang --target=arm-arm-none-eabi -march=armv8-m.main %s -### \
12 // RUN: -mcmse -mfix-cmse-cve-2021-35465 -mno-fix-cmse-cve-2021-35465 2>&1 |\
13 // RUN: FileCheck %s --check-prefix=CHECK-NOFIX
15 // CHECK-NOFIX: "-target-feature" "-fix-cmse-cve-2021-35465"
18 // Enable the fix
20 // RUN: %clang --target=arm-arm-none-eabi -march=armv8-m.main %s -### \
21 // RUN: -mcmse -mfix-cmse-cve-2021-35465 2>&1 |\
22 // RUN: FileCheck %s --check-prefix=CHECK-FIX
24 // RUN: %clang --target=arm-arm-none-eabi -march=armv8.1-m.main %s -### \
25 // RUN: -mcmse -mfix-cmse-cve-2021-35465 2>&1 |\
26 // RUN: FileCheck %s --check-prefix=CHECK-FIX
28 // RUN: %clang --target=arm-arm-none-eabi -march=armv8-m.main %s -### \
29 // RUN: -mcmse -mno-fix-cmse-cve-2021-35465 -mfix-cmse-cve-2021-35465 2>&1 |\
30 // RUN: FileCheck %s --check-prefix=CHECK-FIX
32 // CHECK-FIX: "-target-feature" "+fix-cmse-cve-2021-35465"
35 // Diagnose the option when used without -mcmse
37 // RUN: %clang --target=arm-arm-none-eabi -march=armv8-m.main %s -### \
38 // RUN: -mfix-cmse-cve-2021-35465 2>&1 |\
39 // RUN: FileCheck %s --check-prefix=CHECK-DIAG
41 // RUN: %clang --target=arm-arm-none-eabi -march=armv8.1-m.main %s -### \
42 // RUN: -mno-fix-cmse-cve-2021-35465 2>&1 |\
43 // RUN: FileCheck %s --check-prefix=CHECK-DIAG
45 // CHECK-DIAG: error: option 'm{{.*}}fix-cmse-cve-2021-35465' cannot be specified without '-mcmse'