1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -O0 | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -O0 -disable-fp-elim | FileCheck -check-prefix CHECK-WITHFP %s
4 ; Make sure a reasonably sane prologue and epilogue are
5 ; generated. This test is not robust in the face of an frame-handling
6 ; evolving, but still has value for unrelated changes, I
9 ; In particular, it will fail when ldp/stp are used for frame setup,
10 ; when FP-elim is implemented, and when addressing from FP is
14 @local_addr = global i64* null
18 define void @trivial_func() nounwind {
19 ; CHECK: trivial_func: // @trivial_func
26 define void @trivial_fp_func() {
27 ; CHECK-WITHFP-LABEL: trivial_fp_func:
29 ; CHECK-WITHFP: sub sp, sp, #16
30 ; CHECK-WITHFP: stp x29, x30, [sp]
31 ; CHECK-WITHFP-NEXT: mov x29, sp
33 ; Dont't really care, but it would be a Bad Thing if this came after the epilogue.
38 ; CHECK-WITHFP: ldp x29, x30, [sp]
39 ; CHECK-WITHFP: add sp, sp, #16
44 define void @stack_local() {
45 %local_var = alloca i64
46 ; CHECK-LABEL: stack_local:
47 ; CHECK: sub sp, sp, #16
50 store i64 %val, i64* %local_var
51 ; CHECK: str {{x[0-9]+}}, [sp, #{{[0-9]+}}]
53 store i64* %local_var, i64** @local_addr
54 ; CHECK: add {{x[0-9]+}}, sp, #{{[0-9]+}}