Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / arm-branch-protection-attr-1.c
blob2a9cc600742f36526aca0d33dfe3c4c4c1811b2b
1 // REQUIRES: arm-registered-target
2 // RUN: %clang_cc1 -triple thumbv7m-unknown-unknown-eabi -emit-llvm %s -o - \
3 // RUN: | FileCheck %s --check-prefix=CHECK
5 __attribute__((target("branch-protection=none"))) void none() {}
6 // CHECK: define{{.*}} void @none() #[[#NONE:]]
8 __attribute__((target("branch-protection=standard"))) void std() {}
9 // CHECK: define{{.*}} void @std() #[[#STD:]]
11 __attribute__((target("branch-protection=bti"))) void btionly() {}
12 // CHECK: define{{.*}} void @btionly() #[[#BTI:]]
14 __attribute__((target("branch-protection=pac-ret"))) void paconly0() {}
15 // CHECK: define{{.*}} void @paconly0() #[[#PAC:]]
17 __attribute__((target("branch-protection=pac-ret+b-key"))) void paconly1() {}
18 // CHECK: define{{.*}} void @paconly1() #[[#PAC]]
20 __attribute__((target("branch-protection=pac-ret+bti"))) void pacbti0() {}
21 // CHECK: define{{.*}} void @pacbti0() #[[#STD]]
23 __attribute__((target("branch-protection=bti+pac-ret"))) void pacbti1() {}
24 // CHECK: define{{.*}} void @pacbti1() #[[#STD]]
26 __attribute__((target("branch-protection=pac-ret+leaf"))) void leaf() {}
27 // CHECK: define{{.*}} void @leaf() #[[#PACLEAF:]]
29 __attribute__((target("branch-protection=pac-ret+leaf+bti"))) void btileaf() {}
30 // CHECK: define{{.*}} void @btileaf() #[[#BTIPACLEAF:]]
32 // CHECK-DAG: attributes #[[#NONE]] = { {{.*}} "branch-target-enforcement"="false" {{.*}} "sign-return-address"="none"
34 // CHECK-DAG: attributes #[[#STD]] = { {{.*}} "branch-target-enforcement"="true" {{.*}} "sign-return-address"="non-leaf"
36 // CHECK-DAG: attributes #[[#BTI]] = { {{.*}} "branch-target-enforcement"="true" {{.*}} "sign-return-address"="none"
38 // CHECK-DAG: attributes #[[#PAC]] = { {{.*}} "branch-target-enforcement"="false" {{.*}} "sign-return-address"="non-leaf"
40 // CHECK-DAG: attributes #[[#PACLEAF]] = { {{.*}} "branch-target-enforcement"="false" {{.*}}"sign-return-address"="all"
42 // CHECK-DAG: attributes #[[#BTIPACLEAF]] = { {{.*}}"branch-target-enforcement"="true" {{.*}} "sign-return-address"="all"