2006-01-27 21:13:27 +00:00
|
|
|
; XFAIL: *
|
2007-02-28 18:38:58 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep 'jmp \*ecx'
|
2005-12-04 06:03:25 +00:00
|
|
|
declare int %putchar(int)
|
|
|
|
|
|
|
|
int %main(){
|
|
|
|
%f = cast int (int, int*, int)* %check_tail to int*
|
|
|
|
%res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
|
|
|
|
ret int %res
|
|
|
|
}
|
|
|
|
|
|
|
|
fastcc int %check_tail(int %x, int* %f, int %g) {
|
|
|
|
%tmp1 = setgt int %x, 0
|
|
|
|
br bool %tmp1, label %if-then, label %if-else
|
|
|
|
|
|
|
|
if-then:
|
|
|
|
%fun_ptr = cast int* %f to int(int, int*, int)*
|
|
|
|
%arg1 = add int %x, -1
|
|
|
|
call int %putchar(int 90)
|
|
|
|
%res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
|
|
|
|
ret int %res
|
|
|
|
|
|
|
|
if-else:
|
|
|
|
ret int %x
|
|
|
|
}
|
|
|
|
|