1 ; RUN: llc -mtriple=thumbv7-windows-msvc -frame-pointer=all %s -o - | FileCheck %s
2 ; RUN: llc -mtriple=thumbv7-windows-msvc -fast-isel -frame-pointer=all %s -o - | FileCheck %s
3 ; RUN: llc -mtriple=thumbv7-windows-msvc %s -o - | FileCheck %s --check-prefix=NOFP
4 ; RUN: llc -mtriple=thumbv7-windows-msvc -fast-isel %s -o - | FileCheck %s --check-prefix=NOFP
6 @env2 = common dso_local global ptr null, align 8
8 define dso_local void @bar() {
9 %1 = call ptr @llvm.sponentry()
10 %2 = load ptr, ptr @env2, align 8
11 %3 = call i32 @_setjmpex(ptr %2, ptr %1) #2
16 ; CHECK: push.w {r11, lr}
18 ; CHECK: add.w r1, r11, #8
22 ; NOFP: push.w {r11, lr}
23 ; NOFP: add r1, sp, #8
26 define dso_local void @foo(ptr) {
27 %2 = alloca ptr, align 8
28 %3 = alloca i32, align 4
29 %4 = alloca [100 x i32], align 4
30 store ptr %0, ptr %2, align 8
31 %5 = call ptr @llvm.sponentry()
32 %6 = load ptr, ptr %2, align 8
33 %7 = call i32 @_setjmpex(ptr %6, ptr %5)
34 store i32 %7, ptr %3, align 4
39 ; CHECK: push.w {r11, lr}
42 ; CHECK: add.w r1, r11, #8
46 ; NOFP: push.w {r11, lr}
48 ; NOFP: add r1, sp, #424
51 define dso_local void @var_args(ptr, ...) {
52 %2 = alloca ptr, align 8
53 %3 = alloca ptr, align 8
54 store ptr %0, ptr %2, align 8
55 call void @llvm.va_start(ptr %3)
56 %4 = load ptr, ptr %3, align 8
57 %5 = getelementptr inbounds i8, ptr %4, i64 8
58 store ptr %5, ptr %3, align 8
59 %6 = load i32, ptr %4, align 8
60 call void @llvm.va_end(ptr %3)
61 %7 = call ptr @llvm.sponentry()
62 %8 = load ptr, ptr @env2, align 8
63 %9 = call i32 @_setjmpex(ptr %8, ptr %7) #3
69 ; CHECK: push.w {r11, lr}
71 ; CHECK: add.w r1, r11, #20
76 ; NOFP: push.w {r11, lr}
78 ; NOFP: add r1, sp, #32
81 define dso_local void @manyargs(i64 %x1, i64 %x2, i64 %x3, i64 %x4, i64 %x5, i64 %x6, i64 %x7, i64 %x8, i64 %x9, i64 %x10) {
82 %1 = call ptr @llvm.sponentry()
83 %2 = load ptr, ptr @env2, align 8
84 %3 = call i32 @_setjmpex(ptr %2, ptr %1) #2
89 ; CHECK: push.w {r11, lr}
91 ; CHECK: add.w r1, r11, #8
95 ; NOFP: push.w {r11, lr}
96 ; NOFP: add r1, sp, #8
99 ; Function Attrs: nounwind readnone
100 declare ptr @llvm.sponentry()
102 ; Function Attrs: returns_twice
103 declare dso_local i32 @_setjmpex(ptr, ptr)
105 ; Function Attrs: nounwind
106 declare void @llvm.va_start(ptr) #1
108 ; Function Attrs: nounwind
109 declare void @llvm.va_end(ptr) #1