blob: c75de5dde8fa609ce6879a5b1b6af661ba4af2c2 [file] [log] [blame]
Tanya Lattnerba93e2d2008-03-19 04:14:49 +00001; RUN: llvm-as < %s | opt -sccp -dce -simplifycfg | llvm-dis | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: not grep br
3
Tanya Lattnerba93e2d2008-03-19 04:14:49 +00004define i32 @test(i32 %param) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005entry:
Tanya Lattnerba93e2d2008-03-19 04:14:49 +00006 %tmp.1 = icmp ne i32 %param, 0 ; <i1> [#uses=1]
7 br i1 %tmp.1, label %endif.0, label %else
8else: ; preds = %entry
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009 br label %endif.0
Tanya Lattnerba93e2d2008-03-19 04:14:49 +000010endif.0: ; preds = %else, %entry
11 %a.0 = phi i32 [ 2, %else ], [ 3, %entry ] ; <i32> [#uses=1]
12 %b.0 = phi i32 [ 3, %else ], [ 2, %entry ] ; <i32> [#uses=1]
13 %tmp.5 = add i32 %a.0, %b.0 ; <i32> [#uses=1]
14 %tmp.7 = icmp ne i32 %tmp.5, 5 ; <i1> [#uses=1]
15 br i1 %tmp.7, label %UnifiedReturnBlock, label %endif.1
16endif.1: ; preds = %endif.0
17 ret i32 0
18UnifiedReturnBlock: ; preds = %endif.0
19 ret i32 2
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020}
Tanya Lattnerba93e2d2008-03-19 04:14:49 +000021