mention the C++ exception problems on alpha
[oota-llvm.git] / test / Feature / varargs.ll
1 ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3 ; RUN: diff %t1.ll %t2.ll
4
5 ; Demonstrate all of the variable argument handling intrinsic functions plus 
6 ; the va_arg instruction.
7
8 implementation
9 declare sbyte* %llvm.va_start()
10 declare sbyte* %llvm.va_copy(sbyte*)
11 declare void %llvm.va_end(sbyte*)
12
13 int %test(int %X, ...) {
14         %ap = call sbyte* %llvm.va_start()
15         %aq = call sbyte* %llvm.va_copy(sbyte* %ap)
16         call void %llvm.va_end(sbyte* %aq)
17         
18         %tmp = vaarg sbyte* %ap, int 
19         %ap2 = vanext sbyte* %ap, int
20
21         call void %llvm.va_end(sbyte* %ap2)
22         ret int %tmp
23 }