1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -tailcallopt | FileCheck %s
3 ; This test is designed to be run in the situation where the
4 ; call-frame is not reserved (hence disable-fp-elim), but where
5 ; callee-pop can occur (hence tailcallopt).
7 declare fastcc void @will_pop([8 x i32], i32 %val)
9 define fastcc void @foo(i32 %in) {
12 %addr = alloca i8, i32 %in
14 ; Normal frame setup stuff:
15 ; CHECK: stp x29, x30, [sp, #-16]!
18 ; Reserve space for call-frame:
19 ; CHECK: str w{{[0-9]+}}, [sp, #-16]!
21 call fastcc void @will_pop([8 x i32] undef, i32 42)
24 ; Since @will_pop is fastcc with tailcallopt, it will put the stack
25 ; back where it needs to be, we shouldn't duplicate that
26 ; CHECK-NOT: sub sp, sp, #16
27 ; CHECK-NOT: add sp, sp,
30 ; CHECK: ldp x29, x30, [sp], #16
34 declare void @wont_pop([8 x i32], i32 %val)
36 define void @foo1(i32 %in) {
39 %addr = alloca i8, i32 %in
40 ; Normal frame setup again
41 ; CHECK: stp x29, x30, [sp, #-16]!
44 ; Reserve space for call-frame
45 ; CHECK: str w{{[0-9]+}}, [sp, #-16]!
47 call void @wont_pop([8 x i32] undef, i32 42)
50 ; This time we *do* need to unreserve the call-frame
51 ; CHECK: add sp, sp, #16
53 ; Check for epilogue (primarily to make sure sp spotted above wasn't
56 ; CHECK: ldp x29, x30, [sp], #16