[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Frontend / arm-ignore-branch-protection-option.c
blob99a2accef3ae2f58b381e6d11ceae442d6f3f853
1 // REQUIRES: arm-registered-target
3 /// Check warning for
4 // RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mbranch-protection=bti %s -S -emit-llvm -o - 2>&1 | FileCheck %s
6 __attribute__((target("arch=cortex-m0"))) void f() {}
8 // CHECK: warning: ignoring the 'branch-protection' attribute because the 'cortex-m0' architecture does not support it [-Wbranch-protection]
9 // CHECK-NEXT: __attribute__((target("arch=cortex-m0"))) void f() {}
11 /// Check there are no branch protection function attributes
13 // CHECK-NOT: attributes { {{.*}} "sign-return-address"
14 // CHECK-NOT: attributes { {{.*}} "sign-return-address-key"
15 // CHECK-NOT: attributes { {{.*}} "branch-target-enforcement"
17 /// Check that there are branch protection module attributes despite the warning.
18 // CHECK: !{i32 8, !"branch-target-enforcement", i32 1}