1 ; RUN: llc -mtriple=thumbv6m-linux-eabi -mattr=+execute-only %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-NOMOVW-SIZE,CHECK-NOMOVW-LIMIT
2 ; RUN: llc -mtriple=thumbv8m.base-linux-eabi -mattr=+execute-only %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-MOVW-SIZE,CHECK-MOVW-LIMIT
3 ; RUN: llc -mtriple=thumbv7m-linux-eabi -mattr=+execute-only %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-MOVW-SIZE,CHECK-MRC-LIMIT
4 ; RUN: llc -mtriple=thumbv8m.main-linux-eabi -mattr=+execute-only %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-MOVW-SIZE,CHECK-MRC-LIMIT
6 %struct.large_struct = type { [500 x i8] }
10 ; CHECK: mov [[SP:r[0-9]+]], sp
11 ; CHECK-MOVW-SIZE-NEXT: movw [[SIZE:r[0-9]+]], #4032
12 ; CHECK-NOMOVW-SIZE-NEXT: movs [[SIZE:r[0-9]+]], #15
13 ; CHECK-NOMOVW-SIZE-NEXT: lsls [[SIZE]], [[SIZE]], #8
14 ; CHECK-NOMOVW-SIZE-NEXT: adds [[SIZE]], #192
15 ; CHECK-NEXT: sub{{s?}} [[SP]], [[SP]], [[SIZE]]
16 ; CHECK-MOVW-LIMIT-NEXT: movw [[LIMIT:r[0-9]+]], :lower16:__STACK_LIMIT
17 ; CHECK-MOVW-LIMIT-NEXT: movt [[LIMIT]], :upper16:__STACK_LIMIT
18 ; CHECK-NOMOVW-LIMIT-NEXT: movs [[LIMIT:r[0-9]+]], :upper8_15:__STACK_LIMIT
19 ; CHECK-NOMOVW-LIMIT-NEXT: lsls [[LIMIT]], [[LIMIT]], #8
20 ; CHECK-NOMOVW-LIMIT-NEXT: adds [[LIMIT]], :upper0_7:__STACK_LIMIT
21 ; CHECK-NOMOVW-LIMIT-NEXT: lsls [[LIMIT]], [[LIMIT]], #8
22 ; CHECK-NOMOVW-LIMIT-NEXT: adds [[LIMIT]], :lower8_15:__STACK_LIMIT
23 ; CHECK-NOMOVW-LIMIT-NEXT: lsls [[LIMIT]], [[LIMIT]], #8
24 ; CHECK-NOMOVW-LIMIT-NEXT: adds [[LIMIT]], :lower0_7:__STACK_LIMIT
25 ; CHECK-MRC-LIMIT-NEXT: p15, #0, [[LIMIT:r[0-9]+]], c13, c0, #3
26 ; CHECK-NEXT: ldr [[LIMIT]], [[[LIMIT]]{{.*}}]
27 ; CHECK-NEXT: cmp [[LIMIT]], [[SP]]
29 ; CHECK-NEXT: @{{.*}}:
30 ; CHECK-MOVW-SIZE-NEXT: movw r4, #4032
31 ; CHECK-NOMOVW-SIZE-NEXT: movs r4, #15
32 ; CHECK-NOMOVW-SIZE-NEXT: lsls r4, r4, #8
33 ; CHECK-NOMOVW-SIZE-NEXT: adds r4, #192
34 ; CHECK-MOVW-SIZE-NEXT: movw r5, #484
35 ; CHECK-NOMOVW-SIZE-NEXT: movs r5, #1
36 ; CHECK-NOMOVW-SIZE-NEXT: lsls r5, r5, #8
37 ; CHECK-NOMOVW-SIZE-NEXT: adds r5, #228
38 ; CHECK-NEXT: push {lr}
39 ; CHECK-NEXT: bl __morestack
41 define void @test(ptr byval(%struct.large_struct) align 4 %arg) #0 {
42 %ptr = alloca i32, i32 1000
43 call void @fn(ptr %ptr)
47 attributes #0 = { "split-stack" }