1 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -frame-pointer=all | 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
20 ; CHECK-NEXT: // %bb.0
26 define void @trivial_fp_func() {
27 ; CHECK-LABEL: trivial_fp_func:
28 ; CHECK: str x30, [sp, #-16]!
29 ; CHECK-NOT: mov x29, sp
31 ; CHECK-WITHFP-ARM64-LABEL: trivial_fp_func:
32 ; CHECK-WITHFP-ARM64: stp x29, x30, [sp, #-16]!
33 ; CHECK-WITHFP-ARM64-NEXT: mov x29, sp
35 ; Dont't really care, but it would be a Bad Thing if this came after the epilogue.
36 ; CHECK-WITHFP-ARM64: bl foo
41 ; CHECK: ldr x30, [sp], #16
44 ; CHECK-WITHFP-ARM64: ldp x29, x30, [sp], #16
45 ; CHECK-WITHFP-ARM64-NEXT: ret
48 define void @stack_local() {
49 %local_var = alloca i64
50 ; CHECK-LABEL: stack_local:
51 ; CHECK: sub sp, sp, #16
53 %val = load i64, i64* @var
54 store i64 %val, i64* %local_var
55 ; CHECK-DAG: str {{x[0-9]+}}, [sp, #{{[0-9]+}}]
57 store i64* %local_var, i64** @local_addr
58 ; CHECK-DAG: add {{x[0-9]+}}, sp, #{{[0-9]+}}