summaryrefslogtreecommitdiff
path: root/test/Feature/varargs.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-08 03:46:51 +0000
committerChris Lattner <sabre@nondot.org>2003-05-08 03:46:51 +0000
commit6d95257a919574e448c069061e2a03c6132bbb6b (patch)
tree7c905e6921887cba6d86181b1fa2ede69c31fc15 /test/Feature/varargs.ll
parent4804824047a7a3b87022541eb143063fffad7ddc (diff)
downloadllvm-6d95257a919574e448c069061e2a03c6132bbb6b.tar.gz
llvm-6d95257a919574e448c069061e2a03c6132bbb6b.tar.bz2
llvm-6d95257a919574e448c069061e2a03c6132bbb6b.tar.xz
Test the whole range of varargs handling stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature/varargs.ll')
-rw-r--r--test/Feature/varargs.ll16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/Feature/varargs.ll b/test/Feature/varargs.ll
index 13f3581fe3..defcd93cc6 100644
--- a/test/Feature/varargs.ll
+++ b/test/Feature/varargs.ll
@@ -1,9 +1,21 @@
+; Demonstrate all of the variable argument handling intrinsic functions plus
+; the va_arg instruction.
-
+implementation
+declare void %llvm.va_start(sbyte**, ...)
+declare void %llvm.va_copy(sbyte**, sbyte*)
+declare void %llvm.va_end(sbyte**)
int %test(int %X, ...) {
%ap = alloca sbyte*
- ; This is not a legal testcase, it just shows the syntax for va_arg
+ %aq = alloca sbyte*
+ call void (sbyte**, ...)* %llvm.va_start(sbyte** %ap, int %X)
+ %apv = load sbyte** %ap
+ call void %llvm.va_copy(sbyte** %aq, sbyte* %apv)
+ call void %llvm.va_end(sbyte** %aq)
+
%tmp = va_arg sbyte** %ap, int
+
+ call void %llvm.va_end(sbyte** %ap)
ret int %tmp
}