Chris Lattner | a104019 | 2003-03-05 21:34:35 +0000 | [diff] [blame^] | 1 | ; 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 | |
| 11 | int %test(bool %a, bool %b) { |
| 12 | br bool %b, label %N, label %Q |
| 13 | Q: |
| 14 | br label %N |
| 15 | N: |
| 16 | %W = phi int [0, %0], [1, %Q] |
| 17 | ; This block should be foldable into M |
| 18 | br label %M |
| 19 | |
| 20 | M: |
| 21 | %R = add int %W, 1 |
| 22 | ret int %R |
| 23 | } |
| 24 | |