blob: d66e93ad34ee9c521a1ed7c8557ae0e8411bafb3 [file] [log] [blame]
Saleem Abdulrasoolfb8a66f2015-01-31 02:26:37 +00001; 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(i8*)
8
9define dllexport arm_aapcs_vfpcc signext i8 @function(i32 %offset) #0 {
10entry:
11 %buffer = alloca [4096 x i8], align 1
David Blaikie79e6c742015-02-27 19:29:02 +000012 %0 = getelementptr inbounds [4096 x i8], [4096 x i8]* %buffer, i32 0, i32 0
Saleem Abdulrasoolfb8a66f2015-01-31 02:26:37 +000013 call arm_aapcs_vfpcc void @initialise(i8* %0)
David Blaikie79e6c742015-02-27 19:29:02 +000014 %arrayidx = getelementptr inbounds [4096 x i8], [4096 x i8]* %buffer, i32 0, i32 %offset
David Blaikiea79ac142015-02-27 21:17:42 +000015 %1 = load i8, i8* %arrayidx, align 1
Saleem Abdulrasoolfb8a66f2015-01-31 02:26:37 +000016 ret i8 %1
17}
18
19attributes #0 = { "stack-probe-size"="8096" }
20
21; CHECK-DEFAULT-CODE-MODEL-NOT: __chkstk
22; CHECK-DEFAULT-CODE-MODEL: sub.w sp, sp, #4096
23
24; CHECK-LARGE-CODE-MODEL-NOT: movw r12, :lower16:__chkstk
25; CHECK-LARGE-CODE-MODEL-NOT: movt r12, :upper16:__chkstk
26; CHECK-LARGE-CODE-MODEL: sub.w sp, sp, #4096
27