3137fa999c05772d0048cca6fac5606fce12836b
[oota-llvm.git] / test / Transforms / SimplifyCFG / PhiBlockMerge2.ll
1 ; Test merging of blocks that only have PHI nodes in them.  This tests the case
2 ; where the mergedinto block doesn't have any PHI nodes, and is in fact 
3 ; dominated by the block-to-be-eliminated
4 ;
5 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N:
6 ;
7
8 define i32 @test(i1 %a, i1 %b) {
9         br i1 %b, label %N, label %Q
10 Q:
11         br label %N
12 N:
13         %W = phi i32 [0, %0], [1, %Q]
14         ; This block should be foldable into M
15         br label %M
16
17 M:
18         %R = add i32 %W, 1
19         ret i32 %R
20 }
21