brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 1f12cba Raw
28 lines · c
1// REQUIRES: arm-registered-target2 3/// Check warning for4// RUN: %clang -target arm-arm-none-eabi %s -S -o - 2>&1 | FileCheck %s5 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() {}10 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() {}13 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() {}16 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() {}19 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() {}22 23/// Check there are no branch protection function attributes24 25// CHECK-NOT:  attributes { {{.*}} "sign-return-address"26// CHECK-NOT:  attributes { {{.*}} "sign-return-address-key"27// CHECK-NOT:  attributes { {{.*}} "branch-target-enforcement"28