1 // REQUIRES: arm-registered-target
4 // RUN: %clang -target arm-arm-none-eabi %s -S -o - 2>&1 | FileCheck %s
6 __attribute__((target("branch-protection=bti"))) void f1() {}
7 __attribute__((target("branch-protection=pac-ret"))) void f2() {}
8 __attribute__((target("branch-protection=bti+pac-ret"))) void f3() {}
9 __attribute__((target("branch-protection=bti+pac-ret+leaf"))) void f4() {}
11 // CHECK: warning: unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored [-Wignored-attributes]
12 // CHECK-NEXT: __attribute__((target("branch-protection=bti"))) void f1() {}
14 // CHECK: warning: unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored [-Wignored-attributes]
15 // CHECK-NEXT: __attribute__((target("branch-protection=pac-ret"))) void f2() {}
17 // CHECK: warning: unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored [-Wignored-attributes]
18 // CHECK-NEXT: __attribute__((target("branch-protection=bti+pac-ret"))) void f3() {}
20 // CHECK: warning: unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored [-Wignored-attributes]
21 // CHECK-NEXT: __attribute__((target("branch-protection=bti+pac-ret+leaf"))) void f4() {}
23 /// Check there are no branch protection function attributes
25 // CHECK-NOT: attributes { {{.*}} "sign-return-address"
26 // CHECK-NOT: attributes { {{.*}} "sign-return-address-key"
27 // CHECK-NOT: attributes { {{.*}} "branch-target-enforcement"