Chris Lattner | a8bda21 | 2003-03-05 20:22:50 +0000 | [diff] [blame] | 1 | ; Test merging of blocks that only have PHI nodes in them |
| 2 | ; |
Reid Spencer | 9aafdcf | 2007-04-15 09:21:47 +0000 | [diff] [blame] | 3 | ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep N: |
Chris Lattner | a8bda21 | 2003-03-05 20:22:50 +0000 | [diff] [blame] | 4 | ; |
| 5 | |
| 6 | int %test(bool %a, bool %b) { |
| 7 | br bool %a, label %M, label %O |
| 8 | |
| 9 | O: |
| 10 | br bool %b, label %N, label %Q |
| 11 | Q: |
| 12 | br label %N |
| 13 | N: |
| 14 | %Wp = phi int [0, %O], [1, %Q] |
| 15 | ; This block should be foldable into M |
| 16 | br label %M |
| 17 | |
| 18 | M: |
| 19 | %W = phi int [%Wp, %N], [2, %0] |
| 20 | %R = add int %W, 1 |
| 21 | ret int %R |
| 22 | } |
| 23 | |