blob: aecb6b9244fa926d4103f9fa8863a158c41aee2b [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;
5; RUN: if as < %s | opt -simplifycfg | dis | grep 'N:'
6; RUN: then exit 1
7; RUN: else exit 0
8; RUN: fi
9;
10
11int %test(bool %a, bool %b) {
12 br bool %b, label %N, label %Q
13Q:
14 br label %N
15N:
16 %W = phi int [0, %0], [1, %Q]
17 ; This block should be foldable into M
18 br label %M
19
20M:
21 %R = add int %W, 1
22 ret int %R
23}
24