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