46 lines · c
1// Disable the fix2//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-NOFIX6//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-NOFIX10//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-NOFIX14//15// CHECK-NOFIX: "-target-feature" "-fix-cmse-cve-2021-35465"16 17 18// Enable the fix19//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-FIX23//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-FIX27//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-FIX31//32// CHECK-FIX: "-target-feature" "+fix-cmse-cve-2021-35465"33 34 35// Diagnose the option when used without -mcmse36//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-DIAG40//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-DIAG44//45// CHECK-DIAG: error: option 'm{{.*}}fix-cmse-cve-2021-35465' cannot be specified without '-mcmse'46