blob: 020af7d16c7da6547386b2f5ebc28db6d3a6006f [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; The PHI cannot be eliminated from this testcase, SCCP is mishandling invoke's!
Tanya Lattnerba93e2d2008-03-19 04:14:49 +00002; RUN: llvm-as < %s | opt -sccp | llvm-dis | 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