1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -tailcallopt | FileCheck %s
2 ; RUN: llc -global-isel -global-isel-abort=1 -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -tailcallopt | FileCheck %s
4 ; This test is designed to be run in the situation where the
5 ; call-frame is not reserved (hence disable-fp-elim), but where
6 ; callee-pop can occur (hence tailcallopt).
8 declare fastcc void @will_pop([8 x i64], i32 %val)
10 define fastcc void @foo(i32 %in) {
13 %addr = alloca i8, i32 %in
15 ; Normal frame setup stuff:
16 ; CHECK: stp x29, x30, [sp, #-16]!
19 ; Reserve space for call-frame:
20 ; CHECK: str w{{[0-9]+}}, [sp, #-16]!
22 call fastcc void @will_pop([8 x i64] undef, i32 42)
25 ; Since @will_pop is fastcc with tailcallopt, it will put the stack
26 ; back where it needs to be, we shouldn't duplicate that
27 ; CHECK-NOT: sub sp, sp, #16
28 ; CHECK-NOT: add sp, sp,
31 ; CHECK: ldp x29, x30, [sp], #16
35 declare void @wont_pop([8 x i64], i32 %val)
37 define void @foo1(i32 %in) {
40 %addr = alloca i8, i32 %in
41 ; Normal frame setup again
42 ; CHECK: stp x29, x30, [sp, #-16]!
45 ; Reserve space for call-frame
46 ; CHECK: str w{{[0-9]+}}, [sp, #-16]!
48 call void @wont_pop([8 x i64] undef, i32 42)
51 ; This time we *do* need to unreserve the call-frame
52 ; CHECK: add sp, sp, #16
54 ; Check for epilogue (primarily to make sure sp spotted above wasn't
57 ; CHECK: ldp x29, x30, [sp], #16