blob: 090bde95d971c3653559990e7ae82918202a22d6 [file] [log] [blame]
Tanya Lattner348c6182008-03-25 04:26:08 +00001; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: grep {X3.lcssa = phi i32}
Tanya Lattner348c6182008-03-25 04:26:08 +00003; RUN: llvm-as < %s | opt -lcssa | llvm-dis | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004; RUN: grep {X4 = add i32 3, %X3.lcssa}
5
Tanya Lattner348c6182008-03-25 04:26:08 +00006define void @lcssa(i1 %S2) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007entry:
8 br label %loop.interior
Tanya Lattner348c6182008-03-25 04:26:08 +00009loop.interior: ; preds = %post.if, %entry
10 br i1 %S2, label %if.true, label %if.false
11if.true: ; preds = %loop.interior
12 %X1 = add i32 0, 0 ; <i32> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013 br label %post.if
Tanya Lattner348c6182008-03-25 04:26:08 +000014if.false: ; preds = %loop.interior
15 %X2 = add i32 0, 1 ; <i32> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016 br label %post.if
Tanya Lattner348c6182008-03-25 04:26:08 +000017post.if: ; preds = %if.false, %if.true
18 %X3 = phi i32 [ %X1, %if.true ], [ %X2, %if.false ] ; <i32> [#uses=1]
19 br i1 %S2, label %loop.exit, label %loop.interior
20loop.exit: ; preds = %post.if
21 %X4 = add i32 3, %X3 ; <i32> [#uses=0]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022 ret void
23}
Tanya Lattner348c6182008-03-25 04:26:08 +000024