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 [24 x i64]* null, align 8
8 define dso_local void @bar() {
9 %1 = call i8* @llvm.sponentry()
10 %2 = load [24 x i64]*, [24 x i64]** @env2, align 8
11 %3 = getelementptr inbounds [24 x i64], [24 x i64]* %2, i32 0, i32 0
12 %4 = bitcast i64* %3 to i8*
13 %5 = call i32 @_setjmpex(i8* %4, i8* %1) #2
19 ; CHECK: add x1, x29, #16
22 ; NOFP: str x30, [sp, #-16]!
23 ; NOFP: add x1, sp, #16
25 define dso_local void @foo([24 x i64]*) {
26 %2 = alloca [24 x i64]*, align 8
27 %3 = alloca i32, align 4
28 %4 = alloca [100 x i32], align 4
29 store [24 x i64]* %0, [24 x i64]** %2, align 8
30 %5 = call i8* @llvm.sponentry()
31 %6 = load [24 x i64]*, [24 x i64]** %2, align 8
32 %7 = getelementptr inbounds [24 x i64], [24 x i64]* %6, i32 0, i32 0
33 %8 = bitcast i64* %7 to i8*
34 %9 = call i32 @_setjmpex(i8* %8, i8* %5)
35 store i32 %9, i32* %3, align 4
40 ; CHECK: sub sp, sp, #448
41 ; CHECK: add x29, sp, #432
42 ; CHECK: add x1, x29, #16
45 ; NOFP: sub sp, sp, #432
46 ; NOFP: add x1, sp, #432
48 define dso_local void @var_args(i8*, ...) {
49 %2 = alloca i8*, align 8
50 %3 = alloca i8*, align 8
51 store i8* %0, i8** %2, align 8
52 %4 = bitcast i8** %3 to i8*
53 call void @llvm.va_start(i8* %4)
54 %5 = load i8*, i8** %3, align 8
55 %6 = getelementptr inbounds i8, i8* %5, i64 8
56 store i8* %6, i8** %3, align 8
57 %7 = bitcast i8* %5 to i32*
58 %8 = load i32, i32* %7, align 8
59 %9 = bitcast i8** %3 to i8*
60 call void @llvm.va_end(i8* %9)
61 %10 = call i8* @llvm.sponentry()
62 %11 = load [24 x i64]*, [24 x i64]** @env2, align 8
63 %12 = getelementptr inbounds [24 x i64], [24 x i64]* %11, i32 0, i32 0
64 %13 = bitcast i64* %12 to i8*
65 %14 = call i32 @_setjmpex(i8* %13, i8* %10) #3
70 ; CHECK: sub sp, sp, #96
71 ; CHECK: add x29, sp, #16
72 ; CHECK: add x1, x29, #80
75 ; NOFP: sub sp, sp, #96
76 ; NOFP: add x1, sp, #96
78 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) {
79 %1 = call i8* @llvm.sponentry()
80 %2 = load [24 x i64]*, [24 x i64]** @env2, align 8
81 %3 = getelementptr inbounds [24 x i64], [24 x i64]* %2, i32 0, i32 0
82 %4 = bitcast i64* %3 to i8*
83 %5 = call i32 @_setjmpex(i8* %4, i8* %1) #2
88 ; CHECK: stp x29, x30, [sp, #-16]!
89 ; CHECK: add x1, x29, #16
91 ; NOFP: str x30, [sp, #-16]!
92 ; NOFP: add x1, sp, #16
94 ; Function Attrs: nounwind readnone
95 declare i8* @llvm.sponentry()
97 ; Function Attrs: returns_twice
98 declare dso_local i32 @_setjmpex(i8*, i8*)
100 ; Function Attrs: nounwind
101 declare void @llvm.va_start(i8*) #1
103 ; Function Attrs: nounwind
104 declare void @llvm.va_end(i8*) #1