1 ; RUN: llc -verify-machineinstrs -mtriple=arm64-none-linux-gnu -frame-pointer=all -disable-post-ra < %s | FileCheck %s
2 declare void @use_addr(i8*)
4 @addr = global i8* null
6 define void @test_bigframe() {
7 ; CHECK-LABEL: test_bigframe:
8 ; CHECK: .cfi_startproc
10 %var1 = alloca i8, i32 20000000
11 %var2 = alloca i8, i32 16
12 %var3 = alloca i8, i32 20000000
14 ; CHECK: sub sp, sp, #4095, lsl #12
15 ; CHECK: sub sp, sp, #4095, lsl #12
16 ; CHECK: sub sp, sp, #1575, lsl #12
17 ; CHECK: sub sp, sp, #2576
18 ; CHECK: .cfi_def_cfa_offset 40000032
21 ; CHECK: add [[TMP:x[0-9]+]], sp, #4095, lsl #12
22 ; CHECK: add [[TMP1:x[0-9]+]], [[TMP]], #787, lsl #12
23 ; CHECK: add {{x[0-9]+}}, [[TMP1]], #3344
24 store volatile i8* %var1, i8** @addr
26 %var1plus2 = getelementptr i8, i8* %var1, i32 2
27 store volatile i8* %var1plus2, i8** @addr
29 ; CHECK: add [[TMP:x[0-9]+]], sp, #4095, lsl #12
30 ; CHECK: add [[TMP1:x[0-9]+]], [[TMP]], #787, lsl #12
31 ; CHECK: add {{x[0-9]+}}, [[TMP1]], #3328
32 store volatile i8* %var2, i8** @addr
34 %var2plus2 = getelementptr i8, i8* %var2, i32 2
35 store volatile i8* %var2plus2, i8** @addr
37 store volatile i8* %var3, i8** @addr
39 %var3plus2 = getelementptr i8, i8* %var3, i32 2
40 store volatile i8* %var3plus2, i8** @addr
42 ; CHECK: add sp, sp, #4095, lsl #12
43 ; CHECK: add sp, sp, #4095, lsl #12
44 ; CHECK: add sp, sp, #1575, lsl #12
45 ; CHECK: add sp, sp, #2576
50 define void @test_mediumframe() {
51 ; CHECK-LABEL: test_mediumframe:
52 %var1 = alloca i8, i32 1000000
53 %var2 = alloca i8, i32 16
54 %var3 = alloca i8, i32 1000000
55 ; CHECK: sub sp, sp, #488, lsl #12
56 ; CHECK-NEXT: sub sp, sp, #1168
58 store volatile i8* %var1, i8** @addr
59 ; CHECK: add [[VAR1ADDR:x[0-9]+]], sp, #244, lsl #12
60 ; CHECK: add [[VAR1ADDR]], [[VAR1ADDR]], #592
62 ; CHECK: add [[VAR2ADDR:x[0-9]+]], sp, #244, lsl #12
63 ; CHECK: add [[VAR2ADDR]], [[VAR2ADDR]], #576
65 store volatile i8* %var2, i8** @addr
66 ; CHECK: add sp, sp, #488, lsl #12
67 ; CHECK: add sp, sp, #1168