| Chris Lattner | 9115973 | 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 | ; | 
| Chris Lattner | cd1d05a | 2003-06-28 23:13:12 +0000 | [diff] [blame] | 5 | ; RUN: as < %s | opt -simplifycfg | dis | not grep 'N:' | 
| Chris Lattner | 9115973 | 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 |  |