1 ; RUN: llc -mtriple=aarch64-none-eabi < %s | FileCheck %s
4 ; CHECK-NOT: paci{{[a,b]}}sp
5 ; CHECK-NOT: auti{{[a,b]}}sp
6 define i32 @leaf(i32 %x) {
10 ; CHECK-LABEL: @leaf_sign_none
11 ; CHECK-NOT: paci{{[a,b]}}sp
12 ; CHECK-NOT: auti{{[a,b]}}sp
13 define i32 @leaf_sign_none(i32 %x) "sign-return-address"="none" {
17 ; CHECK-LABEL: @leaf_sign_non_leaf
18 ; CHECK-NOT: paci{{[a,b]}}sp
19 ; CHECK-NOT: auti{{[a,b]}}sp
20 define i32 @leaf_sign_non_leaf(i32 %x) "sign-return-address"="non-leaf" {
24 ; CHECK-LABEL: @leaf_sign_all
28 define i32 @leaf_sign_all(i32 %x) "sign-return-address"="all" {
32 ; CHECK: @leaf_clobbers_lr
34 ; CHECK: str x30, [sp, #-16]!
35 ; CHECK: ldr x30, [sp], #16
38 define i64 @leaf_clobbers_lr(i64 %x) "sign-return-address"="non-leaf" {
39 call void asm sideeffect "mov x30, $0", "r,~{lr}"(i64 %x) #1
45 ; CHECK: @non_leaf_sign_all
49 define i32 @non_leaf_sign_all(i32 %x) "sign-return-address"="all" {
50 %call = call i32 @foo(i32 %x)
54 ; CHECK: @non_leaf_sign_non_leaf
56 ; CHECK: str x30, [sp, #-16]!
57 ; CHECK: ldr x30, [sp], #16
60 define i32 @non_leaf_sign_non_leaf(i32 %x) "sign-return-address"="non-leaf" {
61 %call = call i32 @foo(i32 %x)
65 ; CHECK-LABEL: @leaf_sign_all_v83
70 define i32 @leaf_sign_all_v83(i32 %x) "sign-return-address"="all" "target-features"="+v8.3a" {
74 declare fastcc i64 @bar(i64)
76 ; CHECK-LABEL: @spill_lr_and_tail_call
78 ; CHECK: str x30, [sp, #-16]!
79 ; CHECK: ldr x30, [sp], #16
82 define fastcc void @spill_lr_and_tail_call(i64 %x) "sign-return-address"="all" {
83 call void asm sideeffect "mov x30, $0", "r,~{lr}"(i64 %x) #1
84 tail call fastcc i64 @bar(i64 %x)
88 ; CHECK-LABEL: @leaf_sign_all_a_key
91 define i32 @leaf_sign_all_a_key(i32 %x) "sign-return-address"="all" "sign-return-address-key"="a_key" {
95 ; CHECK-LABEL: @leaf_sign_all_b_key
98 define i32 @leaf_sign_all_b_key(i32 %x) "sign-return-address"="all" "sign-return-address-key"="b_key" {
102 ; CHECK-LABEL: @leaf_sign_all_v83_b_key
107 define i32 @leaf_sign_all_v83_b_key(i32 %x) "sign-return-address"="all" "target-features"="+v8.3a" "sign-return-address-key"="b_key" {