blob: 447f49e9ad5e8edf0243c3e6a7e8d07ef0e5fc6c [file] [log] [blame]
Chris Lattner3afb81e2006-04-13 18:15:24 +00001; PR672
Reid Spencer69ccadd2006-12-02 04:23:10 +00002; RUN: llvm-upgrade < %s | llvm-as | lli
Chris Lattner8e222002005-12-03 07:14:47 +00003
Chris Lattner8e222002005-12-03 07:14:47 +00004int %main(){
5 %f = cast int (int, int*, int)* %check_tail to int*
6 %res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
7 ret int %res
8}
9fastcc int %check_tail(int %x, int* %f, int %g) {
10 %tmp1 = setgt int %x, 0
11 br bool %tmp1, label %if-then, label %if-else
12
13if-then:
14 %fun_ptr = cast int* %f to int(int, int*, int)*
15 %arg1 = add int %x, -1
16 %res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
17 ret int %res
18
19if-else:
20 ret int %x
21}