1 ; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s
3 define win64cc void @pass_va(i32 %count, ...) nounwind {
5 ; CHECK: str x30, [sp, #-80]!
6 ; CHECK: add x8, sp, #24
7 ; CHECK: add x0, sp, #24
8 ; CHECK: stp x1, x2, [sp, #24]
9 ; CHECK: stp x3, x4, [sp, #40]
10 ; CHECK: stp x5, x6, [sp, #56]
11 ; CHECK: str x7, [sp, #72]
12 ; CHECK: str x8, [sp, #8]
13 ; CHECK: bl other_func
14 ; CHECK: ldr x30, [sp], #80
16 %ap = alloca i8*, align 8
17 %ap1 = bitcast i8** %ap to i8*
18 call void @llvm.va_start(i8* %ap1)
19 %ap2 = load i8*, i8** %ap, align 8
20 call void @other_func(i8* %ap2)
24 declare void @other_func(i8*) local_unnamed_addr
26 declare void @llvm.va_start(i8*) nounwind
27 declare void @llvm.va_copy(i8*, i8*) nounwind
30 ; CHECK: sub sp, sp, #16
31 ; CHECK: add x8, sp, #24
32 ; CHECK: add x0, sp, #24
33 ; CHECK: str x8, [sp, #8]
34 ; CHECK: add sp, sp, #16
36 define win64cc i8* @f9(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, ...) nounwind {
38 %ap = alloca i8*, align 8
39 %ap1 = bitcast i8** %ap to i8*
40 call void @llvm.va_start(i8* %ap1)
41 %ap2 = load i8*, i8** %ap, align 8
46 ; CHECK: sub sp, sp, #16
47 ; CHECK: add x8, sp, #16
48 ; CHECK: add x0, sp, #16
49 ; CHECK: str x8, [sp, #8]
50 ; CHECK: add sp, sp, #16
52 define win64cc i8* @f8(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, ...) nounwind {
54 %ap = alloca i8*, align 8
55 %ap1 = bitcast i8** %ap to i8*
56 call void @llvm.va_start(i8* %ap1)
57 %ap2 = load i8*, i8** %ap, align 8
62 ; CHECK: sub sp, sp, #32
63 ; CHECK: add x8, sp, #24
64 ; CHECK: str x7, [sp, #24]
65 ; CHECK: add x0, sp, #24
66 ; CHECK: str x8, [sp, #8]
67 ; CHECK: add sp, sp, #32
69 define win64cc i8* @f7(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, ...) nounwind {
71 %ap = alloca i8*, align 8
72 %ap1 = bitcast i8** %ap to i8*
73 call void @llvm.va_start(i8* %ap1)
74 %ap2 = load i8*, i8** %ap, align 8