1 ; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-linux-gnu -mattr=+reserve-x18 | FileCheck %s
3 define void @f1() shadowcallstack {
12 define void @f2() shadowcallstack {
22 define i32 @f3() shadowcallstack {
24 ; CHECK: str x30, [x18], #8
25 ; CHECK: .cfi_escape 0x16, 0x12, 0x02, 0x82, 0x78
26 ; CHECK: str x30, [sp, #-16]!
27 %res = call i32 @bar()
28 %res1 = add i32 %res, 1
29 ; CHECK: ldr x30, [sp], #16
30 ; CHECK: ldr x30, [x18, #-8]!
35 define i32 @f4() shadowcallstack {
37 %res1 = call i32 @bar()
38 %res2 = call i32 @bar()
39 %res3 = call i32 @bar()
40 %res4 = call i32 @bar()
41 %res12 = add i32 %res1, %res2
42 %res34 = add i32 %res3, %res4
43 %res1234 = add i32 %res12, %res34
44 ; CHECK: ldp x30,{{.*}}, [sp
45 ; CHECK: ldr x30, [x18, #-8]!
50 define i32 @f5() shadowcallstack nounwind {
52 ; CHECK-NOT: .cfi_escape
53 %res = call i32 @bar()
54 %res1 = add i32 %res, 1