blob: 6f86587b24d649d70352c0be87c1b260a07285cc [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This test checks to make sure phi nodes are updated properly
2;
Tanya Lattner003eae52008-03-10 07:21:50 +00003; RUN: llvm-as < %s | opt -tailduplicate -disable-output
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner003eae52008-03-10 07:21:50 +00005define i32 @test(i1 %c, i32 %X, i32 %Y) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006 br label %L
Tanya Lattner003eae52008-03-10 07:21:50 +00007L: ; preds = %F, %0
8 %A = add i32 %X, %Y ; <i32> [#uses=1]
9 br i1 %c, label %T, label %F
10F: ; preds = %L
11 br i1 %c, label %L, label %T
12T: ; preds = %F, %L
13 %V = phi i32 [ %A, %L ], [ 0, %F ] ; <i32> [#uses=1]
14 ret i32 %V
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015}
Tanya Lattner003eae52008-03-10 07:21:50 +000016