blob: 460963d2631d7329225c603e73bf1b9c1f6bbf29 [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 Gohman5bb7c7c2009-09-08 22:34:10 +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