Chris Lattner | 3afb81e | 2006-04-13 18:15:24 +0000 | [diff] [blame] | 1 | ; PR672 |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 2 | ; RUN: llvm-upgrade < %s | llvm-as | lli |
Chris Lattner | 8e22200 | 2005-12-03 07:14:47 +0000 | [diff] [blame] | 3 | |
Chris Lattner | 8e22200 | 2005-12-03 07:14:47 +0000 | [diff] [blame] | 4 | int %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 | } |
| 9 | fastcc 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 | |
| 13 | if-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 | |
| 19 | if-else: |
| 20 | ret int %x |
| 21 | } |