[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGen / aarch64-sign-return-address.c
blob8bc54b1a56c38cbb16ca210896dfab2256b63e97
1 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -msign-return-address=none %s | FileCheck %s --check-prefix=CHECK --check-prefix=NONE
2 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -msign-return-address=all %s | FileCheck %s --check-prefix=CHECK --check-prefix=ALL
3 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -msign-return-address=non-leaf %s | FileCheck %s --check-prefix=CHECK --check-prefix=PART
5 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -mbranch-protection=none %s | FileCheck %s --check-prefix=CHECK --check-prefix=NONE
6 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -mbranch-protection=pac-ret+leaf %s | FileCheck %s --check-prefix=CHECK --check-prefix=ALL
7 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -mbranch-protection=pac-ret+b-key %s | FileCheck %s --check-prefix=CHECK --check-prefix=B-KEY
8 // RUN: %clang -target aarch64-none-elf -S -emit-llvm -o - -mbranch-protection=bti %s | FileCheck %s --check-prefix=CHECK --check-prefix=BTE
10 // REQUIRES: aarch64-registered-target
12 // Check there are no branch protection function attributes
14 // CHECK-LABEL: @foo() #[[#ATTR:]]
16 // CHECK-NOT: attributes #[[#ATTR]] = { {{.*}} "sign-return-address"
17 // CHECK-NOT: attributes #[[#ATTR]] = { {{.*}} "sign-return-address-key"
18 // CHECK-NOT: attributes #[[#ATTR]] = { {{.*}} "branch-target-enforcement"
20 // Check module attributes
22 // NONE-NOT: !"branch-target-enforcement"
23 // ALL-NOT: !"branch-target-enforcement"
24 // PART-NOT: !"branch-target-enforcement"
25 // BTE: !{i32 8, !"branch-target-enforcement", i32 1}
26 // B-KEY-NOT: !"branch-target-enforcement"
28 // NONE-NOT: !"sign-return-address"
29 // ALL: !{i32 8, !"sign-return-address", i32 1}
30 // PART: !{i32 8, !"sign-return-address", i32 1}
31 // BTE-NOT: !"sign-return-address"
32 // B-KEY: !{i32 8, !"sign-return-address", i32 1}
34 // NONE-NOT: !"sign-return-address-all"
35 // ALL: !{i32 8, !"sign-return-address-all", i32 1}
36 // PART-NOT: !"sign-return-address-all"
37 // BTE-NOT: !"sign-return-address-all"
38 // B-KEY-NOT: !"sign-return-address-all"
40 // NONE-NOT: !"sign-return-address-with-bkey"
41 // ALL-NOT: !"sign-return-address-with-bkey"
42 // PART-NOT: !"sign-return-address-with-bkey"
43 // BTE-NOT: !"sign-return-address-with-bkey"
44 // B-KEY: !{i32 8, !"sign-return-address-with-bkey", i32 1}
46 void foo() {}