For PR1319:
[oota-llvm.git] / test / CodeGen / X86 / 2005-12-03-IndirectTailCall.ll
1 ; XFAIL: *
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {jmp \\*ecx}
3 declare int %putchar(int)
4
5 int %main(){ 
6  %f   = cast int (int, int*, int)* %check_tail to int*
7  %res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
8  ret int %res
9 }
10
11 fastcc int %check_tail(int %x, int* %f, int %g) {
12         %tmp1 = setgt int %x, 0
13         br bool %tmp1, label %if-then, label %if-else
14
15 if-then:
16         %fun_ptr = cast int* %f to int(int, int*, int)* 
17         %arg1    = add int %x, -1
18         call int %putchar(int 90)       
19         %res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
20         ret int %res
21
22 if-else:
23         ret int %x
24 }
25