xref: /llvm-project/llvm/test/CodeGen/ARM/Windows/stack-probe-non-default.ll (revision bed1c7f061aa12417aa081e334afdba45767b938)
1; RUN: llc -mtriple thumbv7-windows -mcpu cortex-a9 -o - %s \
2; RUN:     | FileCheck %s -check-prefix CHECK-DEFAULT-CODE-MODEL
3
4; RUN: llc -mtriple thumbv7-windows -mcpu cortex-a9 -code-model large -o - %s \
5; RUN:     | FileCheck %s -check-prefix CHECK-LARGE-CODE-MODEL
6
7declare dllimport arm_aapcs_vfpcc void @initialise(ptr)
8
9define dllexport arm_aapcs_vfpcc signext i8 @function(i32 %offset) #0 {
10entry:
11  %buffer = alloca [4096 x i8], align 1
12  call arm_aapcs_vfpcc void @initialise(ptr %buffer)
13  %arrayidx = getelementptr inbounds [4096 x i8], ptr %buffer, i32 0, i32 %offset
14  %0 = load i8, ptr %arrayidx, align 1
15  ret i8 %0
16}
17
18attributes #0 = { "stack-probe-size"="8096" }
19
20; CHECK-DEFAULT-CODE-MODEL-NOT: __chkstk
21; CHECK-DEFAULT-CODE-MODEL: sub.w sp, sp, #4096
22
23; CHECK-LARGE-CODE-MODEL-NOT: movw r12, :lower16:__chkstk
24; CHECK-LARGE-CODE-MODEL-NOT: movt r12, :upper16:__chkstk
25; CHECK-LARGE-CODE-MODEL: sub.w sp, sp, #4096
26
27