Chris Lattner | 664c953 | 2002-02-25 00:34:18 +0000 | [diff] [blame] | 1 | ; Inlining used to break PHI nodes. This tests that they are correctly updated |
| 2 | ; when a node is split around the call instruction. The verifier caught the error. |
| 3 | ; |
Misha Brukman | e78760e | 2003-09-16 15:29:54 +0000 | [diff] [blame] | 4 | ; RUN: llvm-as < %s | opt -inline |
Chris Lattner | 664c953 | 2002-02-25 00:34:18 +0000 | [diff] [blame] | 5 | ; |
| 6 | implementation |
| 7 | |
| 8 | ulong "test"(ulong %X) |
| 9 | begin |
| 10 | ret ulong %X |
| 11 | end |
| 12 | |
| 13 | ulong "fib"(ulong %n) |
| 14 | begin |
| 15 | %T = setlt ulong %n, 2 ; {bool}:0 |
| 16 | br bool %T, label %BaseCase, label %RecurseCase |
| 17 | |
| 18 | RecurseCase: |
| 19 | %result = call ulong %test(ulong %n) |
| 20 | br label %BaseCase |
| 21 | |
| 22 | BaseCase: |
| 23 | %X = phi ulong [1, %0], [2, %RecurseCase] |
| 24 | ret ulong %X |
| 25 | end |
| 26 | |