1 ; RUN: llc < %s -mtriple=aarch64-windows | FileCheck %s
3 define dso_local i32 @func(ptr %g, i32 %a) "sign-return-address"="non-leaf" "sign-return-address-key"="b_key" {
9 define dso_local i32 @func2(ptr %g, i32 %a) "sign-return-address"="non-leaf" "sign-return-address-key"="b_key" "target-features"="+v8.3a" {
11 tail call void %g() #2
17 ; CHECK-NEXT: .seh_proc func
18 ; CHECK-NEXT: // %bb.0:
19 ; CHECK-NEXT: hint #27
20 ; CHECK-NEXT: .seh_pac_sign_lr
21 ; CHECK-NEXT: str x19, [sp, #-16]!
22 ; CHECK-NEXT: .seh_save_reg_x x19, 16
23 ; CHECK-NEXT: str x30, [sp, #8]
24 ; CHECK-NEXT: .seh_save_reg x30, 8
25 ; CHECK-NEXT: .seh_endprologue
27 ; CHECK: .seh_startepilogue
28 ; CHECK-NEXT: ldr x30, [sp, #8]
29 ; CHECK-NEXT: .seh_save_reg x30, 8
30 ; CHECK-NEXT: ldr x19, [sp], #16
31 ; CHECK-NEXT: .seh_save_reg_x x19, 16
32 ; CHECK-NEXT: hint #31
33 ; CHECK-NEXT: .seh_pac_sign_lr
34 ; CHECK-NEXT: .seh_endepilogue
36 ; CHECK-NEXT: .seh_endfunclet
37 ; CHECK-NEXT: .seh_endproc
39 ;; For func2, check that the potentially folded autibsp+ret -> retab
40 ;; is handled correctly - currently we inhibit producing retab here.
43 ; CHECK-NEXT: .seh_proc func2
44 ; CHECK-NEXT: // %bb.0:
46 ; CHECK-NEXT: .seh_pac_sign_lr
47 ; CHECK-NEXT: str x19, [sp, #-16]!
48 ; CHECK-NEXT: .seh_save_reg_x x19, 16
49 ; CHECK-NEXT: str x30, [sp, #8]
50 ; CHECK-NEXT: .seh_save_reg x30, 8
51 ; CHECK-NEXT: .seh_endprologue
53 ; CHECK: .seh_startepilogue
54 ; CHECK-NEXT: ldr x30, [sp, #8]
55 ; CHECK-NEXT: .seh_save_reg x30, 8
56 ; CHECK-NEXT: ldr x19, [sp], #16
57 ; CHECK-NEXT: .seh_save_reg_x x19, 16
59 ; CHECK-NEXT: .seh_pac_sign_lr
60 ; CHECK-NEXT: .seh_endepilogue
62 ; CHECK-NEXT: .seh_endfunclet
63 ; CHECK-NEXT: .seh_endproc