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 | d77a44363141923a5b5f01feff3d42aaf42ec2dc (patch) | |
tree | 0f8f6f7ae89f69aba13056c5bc6c06b65c842a1f /llvm/test/CodeGen/X86/win64_vararg.ll | |
parent | ff8568855912183af5bcf759e4d537494455d8e1 (diff) | |
download | bcm5719-llvm-d77a44363141923a5b5f01feff3d42aaf42ec2dc.tar.gz bcm5719-llvm-d77a44363141923a5b5f01feff3d42aaf42ec2dc.zip |
va_args support for Win64.
Patch by Cameron!
llvm-svn: 115480
Diffstat (limited to 'llvm/test/CodeGen/X86/win64_vararg.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/win64_vararg.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/win64_vararg.ll b/llvm/test/CodeGen/X86/win64_vararg.ll new file mode 100644 index 00000000000..072f36afb7b --- /dev/null +++ b/llvm/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 |