diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2010-10-03 22:52:07 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2010-10-03 22:52:07 +0000 |
commit | e7beda183db01deffb626bc154b42a0bac27b1de (patch) | |
tree | 1f191f53e8e272a1b883a427df833e9eb74517eb /test/CodeGen/X86/win64_vararg.ll | |
parent | 6af61ca789ae3c18bc03bc3256244f80bb0938f8 (diff) | |
download | llvm-e7beda183db01deffb626bc154b42a0bac27b1de.tar.gz llvm-e7beda183db01deffb626bc154b42a0bac27b1de.tar.bz2 llvm-e7beda183db01deffb626bc154b42a0bac27b1de.tar.xz |
va_args support for Win64.
Patch by Cameron!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/win64_vararg.ll')
-rw-r--r-- | test/CodeGen/X86/win64_vararg.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/win64_vararg.ll b/test/CodeGen/X86/win64_vararg.ll new file mode 100644 index 0000000000..072f36afb7 --- /dev/null +++ b/test/CodeGen/X86/win64_vararg.ll @@ -0,0 +1,20 @@ +; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s + +; Verify that the var arg parameters which are passed in registers are stored +; in home stack slots allocated by the caller and that AP is correctly +; calculated. +define void @average_va(i32 %count, ...) nounwind { +entry: +; CHECK: subq $40, %rsp +; CHECK: movq %r9, 72(%rsp) +; CHECK: movq %r8, 64(%rsp) +; CHECK: movq %rdx, 56(%rsp) +; CHECK: leaq 56(%rsp), %rax + + %ap = alloca i8*, align 8 ; <i8**> [#uses=1] + %ap1 = bitcast i8** %ap to i8* ; <i8*> [#uses=1] + call void @llvm.va_start(i8* %ap1) + ret void +} + +declare void @llvm.va_start(i8*) nounwind |