blob: d1df2a17b7d77a254e411a424597c6ac4d4e15fe [file] [log] [blame]
Chris Lattnera8bda212003-03-05 20:22:50 +00001; Test merging of blocks that only have PHI nodes in them
2;
3; RUN: if as < %s | opt -simplifycfg | dis | grep 'N:'
4; RUN: then exit 1
5; RUN: else exit 0
6; RUN: fi
7;
8
9int %test(bool %a, bool %b) {
10 br bool %a, label %M, label %O
11
12O:
13 br bool %b, label %N, label %Q
14Q:
15 br label %N
16N:
17 %Wp = phi int [0, %O], [1, %Q]
18 ; This block should be foldable into M
19 br label %M
20
21M:
22 %W = phi int [%Wp, %N], [2, %0]
23 %R = add int %W, 1
24 ret int %R
25}
26