| 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 |
| 10 |
// |
| 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 |
| 14 |
// |
| 15 |
// CHECK-NOFIX: "-target-feature" "-fix-cmse-cve-2021-35465" |
| 16 |
|
| 17 |
|
| 18 |
// Enable the fix |
| 19 |
// |
| 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 |
| 23 |
// |
| 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 |
| 27 |
// |
| 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 |
| 31 |
// |
| 32 |
// CHECK-FIX: "-target-feature" "+fix-cmse-cve-2021-35465" |
| 33 |
|
| 34 |
|
| 35 |
// Diagnose the option when used without -mcmse |
| 36 |
// |
| 37 |
// RUN: not %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 |
| 40 |
// |
| 41 |
// RUN: not %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 |
| 44 |
// |
| 45 |
// CHECK-DIAG: error: option 'm{{.*}}fix-cmse-cve-2021-35465' cannot be specified without '-mcmse' |