Cover non-byte-width BATs situation.
[oota-llvm.git] / test / Integer / varargs_bt.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 void %llvm.va_start(i8** %ap)
10 declare void %llvm.va_copy(i8** %aq, i8** %ap)
11 declare void %llvm.va_end(i8** %ap)
12
13 define i33 %test(i33 %X, ...) {
14         %ap = alloca i8*
15         call void %llvm.va_start(i8** %ap)
16         %tmp = va_arg i8** %ap, i33 
17
18         %aq = alloca i8*
19         call void %llvm.va_copy(i8** %aq, i8** %ap)
20         call void %llvm.va_end(i8** %aq)
21         
22         call void %llvm.va_end(i8** %ap)
23         ret i33 %tmp
24 }