brintos

brintos / llvm-project-archived public Read only

0
0
Text · 829 B · 45bdb37 Raw
19 lines · c
1// REQUIRES: arm-registered-target2 3/// Check warning for4// RUN: %clang -target arm-arm-none-eabi -march=armv7-m -mbranch-protection=bti %s -S -emit-llvm -o - 2>&1 | FileCheck %s5 6__attribute__((target("arch=cortex-m0"))) void f() {}7 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() {}10 11/// Check there are no branch protection function attributes12 13// CHECK-NOT:  attributes { {{.*}} "sign-return-address"14// CHECK-NOT:  attributes { {{.*}} "sign-return-address-key"15// CHECK-NOT:  attributes { {{.*}} "branch-target-enforcement"16 17/// Check that there are branch protection module attributes despite the warning.18// CHECK: !{i32 8, !"branch-target-enforcement", i32 2}19