blob: cbb1a89693775efa246a222cada51e9e8158dba1 [file] [log] [blame]
Tanya Lattner366c2032008-02-19 01:44:26 +00001; Inlining used to break PHI nodes. This tests that they are correctly updated
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; when a node is split around the call instruction. The verifier caught the error.
3;
Tanya Lattner366c2032008-02-19 01:44:26 +00004; RUN: llvm-as < %s | opt -inline
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005;
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006
Tanya Lattner366c2032008-02-19 01:44:26 +00007define i64 @test(i64 %X) {
8 ret i64 %X
9}
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010
Tanya Lattner366c2032008-02-19 01:44:26 +000011define i64 @fib(i64 %n) {
12; <label>:0
13 %T = icmp ult i64 %n, 2 ; <i1> [#uses=1]
14 br i1 %T, label %BaseCase, label %RecurseCase
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015
Tanya Lattner366c2032008-02-19 01:44:26 +000016RecurseCase: ; preds = %0
17 %result = call i64 @test( i64 %n ) ; <i64> [#uses=0]
18 br label %BaseCase
Dan Gohmanf17a25c2007-07-18 16:29:46 +000019
Tanya Lattner366c2032008-02-19 01:44:26 +000020BaseCase: ; preds = %RecurseCase, %0
21 %X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ] ; <i64> [#uses=1]
22 ret i64 %X
23}