blob: 3137fa999c05772d0048cca6fac5606fce12836b [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; 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;
Dan Gohmanf934d4b2008-03-11 02:19:59 +00005; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep N:
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006;
7
Dan Gohmanf934d4b2008-03-11 02:19:59 +00008define i32 @test(i1 %a, i1 %b) {
9 br i1 %b, label %N, label %Q
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010Q:
11 br label %N
12N:
Dan Gohmanf934d4b2008-03-11 02:19:59 +000013 %W = phi i32 [0, %0], [1, %Q]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014 ; This block should be foldable into M
15 br label %M
16
17M:
Dan Gohmanf934d4b2008-03-11 02:19:59 +000018 %R = add i32 %W, 1
19 ret i32 %R
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020}
21