1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -disable-fp-elim | FileCheck -check-prefix CHECK-WITHFP-ARM64 %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-LABEL: trivial_func: // @trivial_func
26 define void @trivial_fp_func() {
27 ; CHECK-WITHFP-AARCH64-LABEL: trivial_fp_func:
28 ; CHECK-WITHFP-AARCH64: sub sp, sp, #16
29 ; CHECK-WITHFP-AARCH64: stp x29, x30, [sp]
30 ; CHECK-WITHFP-AARCH64-NEXT: mov x29, sp
32 ; CHECK-WITHFP-ARM64-LABEL: trivial_fp_func:
33 ; CHECK-WITHFP-ARM64: stp x29, x30, [sp, #-16]!
34 ; CHECK-WITHFP-ARM64-NEXT: mov x29, sp
36 ; Dont't really care, but it would be a Bad Thing if this came after the epilogue.
41 ; CHECK-WITHFP: ldp x29, x30, [sp]
42 ; CHECK-WITHFP: add sp, sp, #16
47 define void @stack_local() {
48 %local_var = alloca i64
49 ; CHECK-LABEL: stack_local:
50 ; CHECK: sub sp, sp, #16
53 store i64 %val, i64* %local_var
54 ; CHECK-DAG: str {{x[0-9]+}}, [sp, #{{[0-9]+}}]
56 store i64* %local_var, i64** @local_addr
57 ; CHECK-DAG: add {{x[0-9]+}}, sp, #{{[0-9]+}}