1 # RUN: llc -run-pass=prologepilog %s -o - | FileCheck %s
3 # Make sure we use the correct offset for stack accesses using the base pointer
4 # within call frame blocks. Key points of test:
5 # + A large SP in ADJCALLSTACKDOWN forces each call to get its own adjustment.
6 # + An over-aligned stack variable means that we must use r6 rather than fp
7 # to access this variables.
9 # Under these circumstances, the ADJCALLSTACKDOWN must not apply to r6 offsets.
12 ; ModuleID = 'simple.ll'
13 source_filename = "simple.ll"
14 target datalayout = "e-m:o-p:32:32-i64:64-a:0:32-n32-S128"
15 target triple = "thumbv7k-apple-ios"
17 declare void @bar([4 x i32], i32)
19 define void @foo(i32 %n) {
27 - { reg: '$r0', virtual-reg: '' }
31 maxCallFrameSize: 2276
33 - { id: 0, name: '', type: spill-slot, offset: 0, alignment: 32, size: 4 }
39 ; CHECK: t2STRi12 killed $r0, $r6, [[OFFSET:[0-9]+]]
40 t2STRi12 killed $r0, %stack.0, 0, 14, $noreg :: (store 4 into %stack.0)
42 ADJCALLSTACKDOWN 2276, 0, 14, $noreg, implicit-def dead $sp, implicit $sp
44 ; CHECK: renamable $r0 = t2LDRi12 $r6, [[OFFSET]]
45 renamable $r0 = t2LDRi12 %stack.0, 0, 14, $noreg, :: (load 4 from %stack.0)
46 renamable $r1 = IMPLICIT_DEF
47 renamable $r2 = IMPLICIT_DEF
48 renamable $r3 = IMPLICIT_DEF
49 tBL 14, $noreg, @bar, csr_ios, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit killed $r2, implicit killed $r3, implicit-def $sp
51 ADJCALLSTACKUP 2276, 0, 14, $noreg, implicit-def dead $sp, implicit $sp