2002-02-25 00:34:18 +00:00
|
|
|
; Inlining used to break PHI nodes. This tests that they are correctly updated
|
|
|
|
; when a node is split around the call instruction. The verifier caught the error.
|
|
|
|
;
|
2003-09-16 15:29:54 +00:00
|
|
|
; RUN: llvm-as < %s | opt -inline
|
2002-02-25 00:34:18 +00:00
|
|
|
;
|
|
|
|
implementation
|
|
|
|
|
|
|
|
ulong "test"(ulong %X)
|
|
|
|
begin
|
|
|
|
ret ulong %X
|
|
|
|
end
|
|
|
|
|
|
|
|
ulong "fib"(ulong %n)
|
|
|
|
begin
|
|
|
|
%T = setlt ulong %n, 2 ; {bool}:0
|
|
|
|
br bool %T, label %BaseCase, label %RecurseCase
|
|
|
|
|
|
|
|
RecurseCase:
|
|
|
|
%result = call ulong %test(ulong %n)
|
|
|
|
br label %BaseCase
|
|
|
|
|
|
|
|
BaseCase:
|
|
|
|
%X = phi ulong [1, %0], [2, %RecurseCase]
|
|
|
|
ret ulong %X
|
|
|
|
end
|
|
|
|
|