New testcase, allow folding of binary operators that use PHI nodes, as long
[oota-llvm.git] / test / Transforms / SCCP / phitest.ll
1 ; RUN: llvm-as < %s | opt -sccp -dce -simplifycfg | llvm-dis | not grep br
2
3 int %test(int %param) {
4 entry:
5         %tmp.1 = setne int %param, 0
6         br bool %tmp.1, label %endif.0, label %else
7
8 else:
9         br label %endif.0
10
11 endif.0:
12         %a.0 = phi int [ 2, %else ], [ 3, %entry ]
13         %b.0 = phi int [ 3, %else ], [ 2, %entry ]
14         %tmp.5 = add int %a.0, %b.0
15         %tmp.7 = setne int %tmp.5, 5
16         br bool %tmp.7, label %UnifiedReturnBlock, label %endif.1
17
18 endif.1:
19         ret int 0
20
21 UnifiedReturnBlock:
22         ret int 2
23 }