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 | ; |
Reid Spencer | 9aafdcf | 2007-04-15 09:21:47 +0000 | [diff] [blame] | 5 | ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep N: |
Chris Lattner | a104019 | 2003-03-05 21:34:35 +0000 | [diff] [blame] | 6 | ; |
| 7 | |
| 8 | int %test(bool %a, bool %b) { |
| 9 | br bool %b, label %N, label %Q |
| 10 | Q: |
| 11 | br label %N |
| 12 | N: |
| 13 | %W = phi int [0, %0], [1, %Q] |
| 14 | ; This block should be foldable into M |
| 15 | br label %M |
| 16 | |
| 17 | M: |
| 18 | %R = add int %W, 1 |
| 19 | ret int %R |
| 20 | } |
| 21 | |