Debian Codegraph @

llvm/test/LTO/AArch64/Inputs/old.ll

raw
1 ;; This file contains the previous semantic of the branch-target-enforcement, sign-return-address.
2 ;; Used for test mixing a mixed link case and also verify the import too in llc.
3
4 ; RUN: llc -mattr=+pauth -mattr=+bti %s -o - | FileCheck %s
5
6 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7 target triple = "aarch64-unknown-linux-gnu"
8
9 define i32 @old_bti() #0 {
10 entry:
11 ret i32 2
12 }
13
14 ; CHECK-LABEL: old_bti:
15 ; CHECK: bti c
16 ; CHECK: mov
17 ; CHECK: ret
18
19 define i32 @old_pac() #1 {
20 entry:
21 ret i32 2
22 }
23
24 ; CHECK-LABEL: old_pac:
25 ; CHECK: paciasp
26 ; CHECK: mov
27 ; CHECK: retaa
28
29
30 define i32 @old_none() #2 {
31 entry:
32 ret i32 3
33 }
34
35 ; CHECK-LABEL: old_none:
36 ; CHECK-NOT: hint
37 ; CHECK-NOT: paci
38 ; CHECK-NOT: bti
39 ; CHECK: ret
40
41 declare i32 @func(i32)
42
43 define i32 @old_none_leaf() #3 {
44 entry:
45 %0 = call i32 @func()
46 ret i32 %0
47 }
48
49 ; CHECK-LABEL: old_none_leaf:
50 ; CHECK: paciasp
51 ; CHECK: bl func
52 ; CHECK: retaa
53
54 attributes #0 = { noinline nounwind optnone "branch-target-enforcement"="true" }
55 attributes #1 = { noinline nounwind optnone "branch-target-enforcement"="false" "sign-return-address"="all" "sign-return-address-key"="a_key" }
56 attributes #2 = { noinline nounwind optnone "branch-target-enforcement"="false" "sign-return-address"="none" }
57 attributes #3 = { noinline nounwind optnone "branch-target-enforcement"="false" "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" }
58
59 ;; Intentionally no module flags