[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGen / aarch64-branch-protection-attr.c
blob3c2714e2feda240d30ea33fe5ba43cfc947e6be7
1 // REQUIRES: aarch64-registered-target
2 // RUN: %clang_cc1 -triple aarch64 -emit-llvm -target-cpu generic -target-feature +v8.5a %s -o - \
3 // RUN: | FileCheck %s --check-prefix=CHECK
5 __attribute__ ((target("branch-protection=none")))
6 void none() {}
7 // CHECK: define{{.*}} void @none() #[[#NONE:]]
9 __attribute__ ((target("branch-protection=standard")))
10 void std() {}
11 // CHECK: define{{.*}} void @std() #[[#STD:]]
13 __attribute__ ((target("branch-protection=bti")))
14 void btionly() {}
15 // CHECK: define{{.*}} void @btionly() #[[#BTI:]]
17 __attribute__ ((target("branch-protection=pac-ret")))
18 void paconly() {}
19 // CHECK: define{{.*}} void @paconly() #[[#PAC:]]
21 __attribute__ ((target("branch-protection=pac-ret+bti")))
22 void pacbti0() {}
23 // CHECK: define{{.*}} void @pacbti0() #[[#PACBTI:]]
25 __attribute__ ((target("branch-protection=bti+pac-ret")))
26 void pacbti1() {}
27 // CHECK: define{{.*}} void @pacbti1() #[[#PACBTI]]
29 __attribute__ ((target("branch-protection=pac-ret+leaf")))
30 void leaf() {}
31 // CHECK: define{{.*}} void @leaf() #[[#PACLEAF:]]
33 __attribute__ ((target("branch-protection=pac-ret+b-key")))
34 void bkey() {}
35 // CHECK: define{{.*}} void @bkey() #[[#PACBKEY:]]
37 __attribute__ ((target("branch-protection=pac-ret+b-key+leaf")))
38 void bkeyleaf0() {}
39 // CHECK: define{{.*}} void @bkeyleaf0() #[[#PACBKEYLEAF:]]
41 __attribute__ ((target("branch-protection=pac-ret+leaf+b-key")))
42 void bkeyleaf1() {}
43 // CHECK: define{{.*}} void @bkeyleaf1() #[[#PACBKEYLEAF]]
45 __attribute__ ((target("branch-protection=pac-ret+leaf+bti")))
46 void btileaf() {}
47 // CHECK: define{{.*}} void @btileaf() #[[#BTIPACLEAF:]]
49 // CHECK-DAG: attributes #[[#NONE]] = { {{.*}} "branch-target-enforcement"="false" {{.*}} "sign-return-address"="none"
51 // CHECK-DAG: attributes #[[#STD]] = { {{.*}} "branch-target-enforcement"="true" {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
53 // CHECK-DAG: attributes #[[#BTI]] = { {{.*}} "branch-target-enforcement"="true" {{.*}} "sign-return-address"="none"
55 // CHECK-DAG: attributes #[[#PAC]] = { {{.*}} "branch-target-enforcement"="false" {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"
57 // CHECK-DAG: attributes #[[#PACLEAF]] = { {{.*}} "branch-target-enforcement"="false" {{.*}}"sign-return-address"="all" "sign-return-address-key"="a_key"
59 // CHECK-DAG: attributes #[[#PACBKEY]] = { {{.*}}"branch-target-enforcement"="false" {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="b_key"
61 // CHECK-DAG: attributes #[[#PACBKEYLEAF]] = { {{.*}} "branch-target-enforcement"="false" {{.*}}"sign-return-address"="all" "sign-return-address-key"="b_key"
63 // CHECK-DAG: attributes #[[#BTIPACLEAF]] = { {{.*}}"branch-target-enforcement"="true" {{.*}} "sign-return-address"="all" "sign-return-address-key"="a_key"