Chris Lattner | 04b9d29 | 2002-09-24 16:13:20 +0000 | [diff] [blame] | 1 | ; This test ensures that the simplifycfg pass continues to constant fold |
| 2 | ; terminator instructions. |
| 3 | |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | not grep br |
Chris Lattner | 04b9d29 | 2002-09-24 16:13:20 +0000 | [diff] [blame] | 5 | |
| 6 | int %test(int %A, int %B) { |
| 7 | J: |
| 8 | %C = add int %A, 12 |
| 9 | br bool true, label %L, label %K ; K is dead! |
| 10 | L: |
| 11 | %D = add int %C, %B |
| 12 | ret int %D |
| 13 | K: |
| 14 | %E = add int %C, %B |
| 15 | ret int %E |
| 16 | } |