brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.3 KiB · c66bce1 Raw
107 lines · c
1// REQUIRES: aarch64-registered-target2// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a %s -o - \3// RUN:                               | FileCheck %s --check-prefix=CHECK4// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a -mbranch-target-enforce %s -o - \5// RUN:                               | FileCheck %s --check-prefix=CHECK6// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a -mguarded-control-stack %s -o - \7// RUN:                               | FileCheck %s --check-prefix=CHECK8// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a -msign-return-address=non-leaf -msign-return-address-key=a_key %s -o - \9// RUN:                               | FileCheck %s --check-prefix=CHECK10// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a -msign-return-address=all -msign-return-address-key=b_key %s -o - \11// RUN:                               | FileCheck %s --check-prefix=CHECK12// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a -mbranch-protection-pauth-lr -msign-return-address=all -msign-return-address-key=a_key %s -o - \13// RUN:                               | FileCheck %s --check-prefix=CHECK14// RUN: %clang_cc1 -triple aarch64 -emit-llvm  -target-cpu generic -target-feature +v8.5a -mguarded-control-stack -mbranch-target-enforce -mbranch-protection-pauth-lr -msign-return-address=all -msign-return-address-key=a_key %s -o - \15// RUN:                               | FileCheck %s --check-prefix=CHECK16 17__attribute__ ((target("branch-protection=none")))18void none() {}19// CHECK: define{{.*}} void @none() #[[#NONE:]]20 21  __attribute__ ((target("branch-protection=standard")))22void std() {}23// CHECK: define{{.*}} void @std() #[[#STD:]]24 25__attribute__ ((target("branch-protection=bti")))26void btionly() {}27// CHECK: define{{.*}} void @btionly() #[[#BTI:]]28 29__attribute__ ((target("branch-protection=pac-ret")))30void paconly() {}31// CHECK: define{{.*}} void @paconly() #[[#PAC:]]32 33__attribute__ ((target("branch-protection=pac-ret+bti")))34void pacbti0() {}35// CHECK: define{{.*}} void @pacbti0() #[[#PACBTI:]]36 37__attribute__ ((target("branch-protection=bti+pac-ret")))38void pacbti1() {}39// CHECK: define{{.*}} void @pacbti1() #[[#PACBTI]]40 41__attribute__ ((target("branch-protection=pac-ret+leaf")))42void leaf() {}43// CHECK: define{{.*}} void @leaf() #[[#PACLEAF:]]44 45__attribute__ ((target("branch-protection=pac-ret+b-key")))46void bkey() {}47// CHECK: define{{.*}} void @bkey() #[[#PACBKEY:]]48 49__attribute__ ((target("branch-protection=pac-ret+b-key+leaf")))50void bkeyleaf0() {}51// CHECK: define{{.*}} void @bkeyleaf0()  #[[#PACBKEYLEAF:]]52 53__attribute__ ((target("branch-protection=pac-ret+leaf+b-key")))54void bkeyleaf1() {}55// CHECK: define{{.*}} void @bkeyleaf1()  #[[#PACBKEYLEAF]]56 57__attribute__ ((target("branch-protection=pac-ret+leaf+bti")))58void btileaf() {}59// CHECK: define{{.*}} void @btileaf() #[[#BTIPACLEAF:]]60 61 62__attribute__ ((target("branch-protection=pac-ret+pc")))63void pauthlr() {}64// CHECK: define{{.*}} void @pauthlr()  #[[#PAUTHLR:]]65 66__attribute__ ((target("branch-protection=pac-ret+pc+b-key")))67void pauthlr_bkey() {}68// CHECK: define{{.*}} void @pauthlr_bkey()  #[[#PAUTHLR_BKEY:]]69 70__attribute__ ((target("branch-protection=pac-ret+pc+leaf")))71void pauthlr_leaf() {}72// CHECK: define{{.*}} void @pauthlr_leaf()  #[[#PAUTHLR_LEAF:]]73 74__attribute__ ((target("branch-protection=pac-ret+pc+bti")))75void pauthlr_bti() {}76// CHECK: define{{.*}} void @pauthlr_bti()  #[[#PAUTHLR_BTI:]]77 78__attribute__ ((target("branch-protection=gcs")))79void gcs() {}80// CHECK: define{{.*}} void @gcs() #[[#GCS:]]81 82// CHECK-DAG: attributes #[[#NONE]] = { {{.*}}83 84// CHECK-DAG: attributes #[[#STD]] = { {{.*}} "branch-target-enforcement" "guarded-control-stack" {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"85 86// CHECK-DAG: attributes #[[#BTI]] = { {{.*}} "branch-target-enforcement"87 88// CHECK-DAG: attributes #[[#PAC]] = { {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="a_key"89 90// CHECK-DAG: attributes #[[#PACLEAF]] = { {{.*}} "sign-return-address"="all" "sign-return-address-key"="a_key"91 92// CHECK-DAG: attributes #[[#PACBKEY]] = { {{.*}} "sign-return-address"="non-leaf" "sign-return-address-key"="b_key"93 94// CHECK-DAG: attributes #[[#PACBKEYLEAF]] = { {{.*}} "sign-return-address"="all" "sign-return-address-key"="b_key"95 96// CHECK-DAG: attributes #[[#BTIPACLEAF]] = { {{.*}} "branch-target-enforcement" {{.*}}"sign-return-address"="all" "sign-return-address-key"="a_key"97 98// CHECK-DAG: attributes #[[#PAUTHLR]] = { {{.*}} "branch-protection-pauth-lr" {{.*}}"sign-return-address"="non-leaf" "sign-return-address-key"="a_key"99 100// CHECK-DAG: attributes #[[#PAUTHLR_BKEY]] = { {{.*}} "branch-protection-pauth-lr" {{.*}}"sign-return-address"="non-leaf" "sign-return-address-key"="b_key"101 102// CHECK-DAG: attributes #[[#PAUTHLR_LEAF]] = { {{.*}} "branch-protection-pauth-lr" {{.*}}"sign-return-address"="all" "sign-return-address-key"="a_key"103 104// CHECK-DAG: attributes #[[#PAUTHLR_BTI]] = { {{.*}} "branch-protection-pauth-lr" {{.*}}"branch-target-enforcement" {{.*}}"sign-return-address"="non-leaf" "sign-return-address-key"="a_key"105 106// CHECK-DAG: attributes #[[#GCS]] = { {{.*}} "guarded-control-stack"107