1 ; RUN: llc < %s -mtriple=thumbv7m -mattr=+execute-only -O0 %s -o - \
2 ; RUN: | FileCheck --check-prefix=CHECK-SUBW-ADDW %s
3 ; RUN: llc < %s -mtriple=thumbv8m.base -mattr=+execute-only -O0 %s -o - \
4 ; RUN: | FileCheck --check-prefix=CHECK-MOVW-MOVT-ADD %s
5 ; RUN: llc < %s -mtriple=thumbv8m.base -mcpu=cortex-m23 -mattr=+execute-only -O0 %s -o - \
6 ; RUN: | FileCheck --check-prefix=CHECK-MOVW-MOVT-ADD %s
7 ; RUN: llc < %s -mtriple=thumbv8m.main -mattr=+execute-only -O0 %s -o - \
8 ; RUN: | FileCheck --check-prefix=CHECK-SUBW-ADDW %s
10 define i8 @test_big_stack_frame() {
11 ; CHECK-SUBW-ADDW-LABEL: test_big_stack_frame:
12 ; CHECK-SUBW-ADDW-NOT: ldr {{r[0-9]+}}, .{{.*}}
13 ; CHECK-SUBW-ADDW: sub.w sp, sp, #65536
14 ; CHECK-SUBW-ADDW-NOT: ldr {{r[0-9]+}}, .{{.*}}
15 ; CHECK-SUBW-ADDW: add.w [[REG1:r[0-9]+|lr]], sp, #255
16 ; CHECK-SUBW-ADDW: add.w {{r[0-9]+}}, [[REG1]], #65280
17 ; CHECK-SUBW-ADDW-NOT: ldr {{r[0-9]+}}, .{{.*}}
18 ; CHECK-SUBW-ADDW: add.w [[REGX:r[0-9]+|lr]], sp, #61440
19 ; CHECK-SUBW-ADDW-NOT: ldr {{r[0-9]+}}, .{{.*}}
20 ; CHECK-SUBW-ADDW: add.w sp, sp, #65536
22 ; CHECK-MOVW-MOVT-ADD-LABEL: test_big_stack_frame:
23 ; CHECK-MOVW-MOVT-ADD-NOT: ldr {{r[0-9]+}}, .{{.*}}
24 ; CHECK-MOVW-MOVT-ADD: movw [[REG1:r[0-9]+]], #0
25 ; CHECK-MOVW-MOVT-ADD: movt [[REG1]], #65535
26 ; CHECK-MOVW-MOVT-ADD: add sp, [[REG1]]
27 ; CHECK-MOVW-MOVT-ADD-NOT: ldr {{r[0-9]+}}, .{{.*}}
28 ; CHECK-MOVW-MOVT-ADD: movw [[REG2:r[0-9]+]], #65532
29 ; CHECK-MOVW-MOVT-ADD: movt [[REG2]], #0
30 ; CHECK-MOVW-MOVT-ADD: add [[REG2]], sp
31 ; CHECK-MOVW-MOVT-ADD-NOT: ldr {{r[0-9]+}}, .{{.*}}
32 ; CHECK-MOVW-MOVT-ADD: movw [[REG3:r[0-9]+]], #65532
33 ; CHECK-MOVW-MOVT-ADD: movt [[REG3]], #0
34 ; CHECK-MOVW-MOVT-ADD: add [[REG3]], sp
35 ; CHECK-MOVW-MOVT-ADD-NOT: ldr {{r[0-9]+}}, .{{.*}}
36 ; CHECK-MOVW-MOVT-ADD: movw [[REG4:r[0-9]+]], #0
37 ; CHECK-MOVW-MOVT-ADD: movt [[REG4]], #1
38 ; CHECK-MOVW-MOVT-ADD: add sp, [[REG4]]
42 %buffer = alloca [65528 x i8], align 1
43 call void @foo(i8* %s1)
44 %load = load i8, i8* %s1
48 declare void @foo(i8*)