mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 00:37:09 +00:00
3f7706b5d2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17568 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
601 B
LLVM
24 lines
601 B
LLVM
; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
|
|
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
|
|
; RUN: diff %t1.ll %t2.ll
|
|
|
|
; Demonstrate all of the variable argument handling intrinsic functions plus
|
|
; the va_arg instruction.
|
|
|
|
implementation
|
|
declare sbyte* %llvm.va_start()
|
|
declare sbyte* %llvm.va_copy(sbyte*)
|
|
declare void %llvm.va_end(sbyte*)
|
|
|
|
int %test(int %X, ...) {
|
|
%ap = call sbyte* %llvm.va_start()
|
|
%aq = call sbyte* %llvm.va_copy(sbyte* %ap)
|
|
call void %llvm.va_end(sbyte* %aq)
|
|
|
|
%tmp = vaarg sbyte* %ap, int
|
|
%ap2 = vanext sbyte* %ap, int
|
|
|
|
call void %llvm.va_end(sbyte* %ap2)
|
|
ret int %tmp
|
|
}
|