• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s
2
3; Verify that the var arg parameters which are passed in registers are stored
4; in home stack slots allocated by the caller and that AP is correctly
5; calculated.
6define void @average_va(i32 %count, ...) nounwind {
7entry:
8; CHECK: pushq
9; CHECK: movq   %r9, 40(%rsp)
10; CHECK: movq   %r8, 32(%rsp)
11; CHECK: movq   %rdx, 24(%rsp)
12; CHECK: leaq   24(%rsp), %rax
13
14  %ap = alloca i8*, align 8                       ; <i8**> [#uses=1]
15  %ap1 = bitcast i8** %ap to i8*                  ; <i8*> [#uses=1]
16  call void @llvm.va_start(i8* %ap1)
17  ret void
18}
19
20declare void @llvm.va_start(i8*) nounwind
21
22; CHECK: f5:
23; CHECK: pushq
24; CHECK: leaq 56(%rsp),
25define i8* @f5(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, ...) nounwind {
26entry:
27  %ap = alloca i8*, align 8
28  %ap1 = bitcast i8** %ap to i8*
29  call void @llvm.va_start(i8* %ap1)
30  ret i8* %ap1
31}
32
33; CHECK: f4:
34; CHECK: pushq
35; CHECK: leaq 48(%rsp),
36define i8* @f4(i64 %a0, i64 %a1, i64 %a2, i64 %a3, ...) nounwind {
37entry:
38  %ap = alloca i8*, align 8
39  %ap1 = bitcast i8** %ap to i8*
40  call void @llvm.va_start(i8* %ap1)
41  ret i8* %ap1
42}
43
44; CHECK: f3:
45; CHECK: pushq
46; CHECK: leaq 40(%rsp),
47define i8* @f3(i64 %a0, i64 %a1, i64 %a2, ...) nounwind {
48entry:
49  %ap = alloca i8*, align 8
50  %ap1 = bitcast i8** %ap to i8*
51  call void @llvm.va_start(i8* %ap1)
52  ret i8* %ap1
53}
54