Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Other / 2002-02-24-InlineBrokePHINodes.ll
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 ;
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline
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