blob: b090e781985a5c2e2ef8dfa2cfd335342488fcf9 [file] [log] [blame]
Chris Lattnerceb536e2003-03-05 20:35:24 +00001; Test merging of blocks with phi nodes.
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) {
10Q:
11 br bool %a, label %N, label %M
12N:
13 br label %M
14M:
15 ; It's ok to merge N and M because the incoming values for W are the
16 ; same for both cases...
17 %W = phi int [2, %N], [2, %Q]
18 %R = add int %W, 1
19 ret int %R
20}
21