Chris Lattner | 128cf79 | 2003-08-17 19:29:34 +0000 | [diff] [blame] | 1 | ; This test checks to make sure that 'br X, Dest, Dest' is folded into |
| 2 | ; 'br Dest' |
| 3 | |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | not grep 'br bool %c2' |
Chris Lattner | 128cf79 | 2003-08-17 19:29:34 +0000 | [diff] [blame] | 5 | |
| 6 | declare void %noop() |
| 7 | |
| 8 | int %test(bool %c1, bool %c2) { |
| 9 | call void %noop() |
| 10 | br bool %c1, label %A, label %Y |
| 11 | A: |
| 12 | call void %noop() |
| 13 | br bool %c2, label %X, label %X ; Can be converted to unconditional br |
| 14 | X: |
| 15 | call void %noop() |
| 16 | ret int 0 |
| 17 | Y: |
| 18 | call void %noop() |
| 19 | br label %X |
| 20 | } |