1 ; RUN: llc -mtriple=aarch64-windows-msvc -frame-pointer=all %s -o - | FileCheck %s
2 ; RUN: llc -mtriple=aarch64-windows-msvc -fast-isel -frame-pointer=all %s -o - | FileCheck %s
3 ; RUN: llc -mtriple=aarch64-windows-msvc %s -o - | FileCheck %s --check-prefix=NOFP
4 ; RUN: llc -mtriple=aarch64-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
17 ; CHECK: add x1, x29, #16
20 ; NOFP: str x30, [sp, #-16]!
21 ; NOFP: add x1, sp, #16
23 define dso_local void @foo(ptr) {
24 %2 = alloca ptr, align 8
25 %3 = alloca i32, align 4
26 %4 = alloca [100 x i32], align 4
27 store ptr %0, ptr %2, align 8
28 %5 = call ptr @llvm.sponentry()
29 %6 = load ptr, ptr %2, align 8
30 %7 = call i32 @_setjmpex(ptr %6, ptr %5)
31 store i32 %7, ptr %3, align 4
36 ; CHECK: sub sp, sp, #448
37 ; CHECK: add x29, sp, #424
38 ; CHECK: add x1, x29, #24
41 ; NOFP: sub sp, sp, #432
42 ; NOFP: add x1, sp, #432
44 define dso_local void @var_args(ptr, ...) {
45 %2 = alloca ptr, align 8
46 %3 = alloca ptr, align 8
47 store ptr %0, ptr %2, align 8
48 call void @llvm.va_start(ptr %3)
49 %4 = load ptr, ptr %3, align 8
50 %5 = getelementptr inbounds i8, ptr %4, i64 8
51 store ptr %5, ptr %3, align 8
52 %6 = load i32, ptr %4, align 8
53 call void @llvm.va_end(ptr %3)
54 %7 = call ptr @llvm.sponentry()
55 %8 = load ptr, ptr @env2, align 8
56 %9 = call i32 @_setjmpex(ptr %8, ptr %7) #3
61 ; CHECK: sub sp, sp, #96
62 ; CHECK: add x29, sp, #16
63 ; CHECK: add x1, x29, #80
66 ; NOFP: sub sp, sp, #96
67 ; NOFP: add x1, sp, #96
69 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) {
70 %1 = call ptr @llvm.sponentry()
71 %2 = load ptr, ptr @env2, align 8
72 %3 = call i32 @_setjmpex(ptr %2, ptr %1) #2
77 ; CHECK: stp x29, x30, [sp, #-16]!
78 ; CHECK: add x1, x29, #16
80 ; NOFP: str x30, [sp, #-16]!
81 ; NOFP: add x1, sp, #16
83 ; Function Attrs: nounwind readnone
84 declare ptr @llvm.sponentry()
86 ; Function Attrs: returns_twice
87 declare dso_local i32 @_setjmpex(ptr, ptr)
89 ; Function Attrs: nounwind
90 declare void @llvm.va_start(ptr) #1
92 ; Function Attrs: nounwind
93 declare void @llvm.va_end(ptr) #1