Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; Test merging of blocks with phi nodes. |
2 | ; | ||||
3 | ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep N: | ||||
4 | ; | ||||
5 | |||||
6 | int %test(bool %a) { | ||||
7 | Q: | ||||
8 | br bool %a, label %N, label %M | ||||
9 | N: | ||||
10 | br label %M | ||||
11 | M: | ||||
12 | ; It's ok to merge N and M because the incoming values for W are the | ||||
13 | ; same for both cases... | ||||
14 | %W = phi int [2, %N], [2, %Q] | ||||
15 | %R = add int %W, 1 | ||||
16 | ret int %R | ||||
17 | } | ||||
18 |