Chris Lattner | ceb536e | 2003-03-05 20:35:24 +0000 | [diff] [blame^] | 1 | ; 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 | |||||
9 | int %test(bool %a) { | ||||
10 | Q: | ||||
11 | br bool %a, label %N, label %M | ||||
12 | N: | ||||
13 | br label %M | ||||
14 | M: | ||||
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 |