1 ; RUN: llvm-as < %s | llvm-dis > %t1.ll
2 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3 ; RUN: diff %t1.ll %t2.ll
5 ; Demonstrate all of the variable argument handling intrinsic functions plus
6 ; the va_arg instruction.
8 declare void @llvm.va_start(ptr)
10 declare void @llvm.va_copy(ptr, ptr)
12 declare void @llvm.va_end(ptr)
14 define i32 @test(i32 %X, ...) {
15 %ap = alloca ptr ; <ptr> [#uses=4]
16 call void @llvm.va_start( ptr %ap )
17 %tmp = va_arg ptr %ap, i32 ; <i32> [#uses=1]
18 %aq = alloca ptr ; <ptr> [#uses=2]
19 call void @llvm.va_copy( ptr %aq, ptr %ap )
20 call void @llvm.va_end( ptr %aq )
21 call void @llvm.va_end( ptr %ap )