blob: 9876375ae88a7e6e86fffe010b45ffc00ae64d82 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; The PHI cannot be eliminated from this testcase, SCCP is mishandling invoke's!
Dan Gohman3c7d3082009-09-11 18:01:28 +00002; RUN: opt < %s -sccp -S | grep phi
Dan Gohmanf17a25c2007-07-18 16:29:46 +00003
Tanya Lattnerba93e2d2008-03-19 04:14:49 +00004declare void @foo()
5
6define i32 @test(i1 %cond) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007Entry:
Tanya Lattnerba93e2d2008-03-19 04:14:49 +00008 br i1 %cond, label %Inv, label %Cont
9Inv: ; preds = %Entry
10 invoke void @foo( )
11 to label %Ok unwind label %Cont
12Ok: ; preds = %Inv
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013 br label %Cont
Tanya Lattnerba93e2d2008-03-19 04:14:49 +000014Cont: ; preds = %Ok, %Inv, %Entry
15 %X = phi i32 [ 0, %Entry ], [ 1, %Ok ], [ 0, %Inv ] ; <i32> [#uses=1]
16 ret i32 %X
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017}
Tanya Lattnerba93e2d2008-03-19 04:14:49 +000018