Chris Lattner | 4f53850 | 2002-05-03 20:12:31 +0000 | [diff] [blame] | 1 | ; This is a basic sanity check for constant propogation. The add instruction |
| 2 | ; should be eliminated. |
| 3 | |
Chris Lattner | 0a1581b | 2002-05-07 20:25:44 +0000 | [diff] [blame] | 4 | ; RUN: if as < %s | opt -constprop -die | dis | grep add |
Chris Lattner | 4f53850 | 2002-05-03 20:12:31 +0000 | [diff] [blame] | 5 | ; RUN: then exit 1 |
| 6 | ; RUN: else exit 0 |
| 7 | ; RUN: fi |
| 8 | |
| 9 | int "test"(bool %B) |
| 10 | begin |
| 11 | br bool %B, label %BB1, label %BB2 |
| 12 | BB1: |
| 13 | %Val = add int 0, 0 |
| 14 | br label %BB3 |
| 15 | BB2: |
| 16 | br label %BB3 |
| 17 | BB3: |
| 18 | %Ret = phi int [%Val, %BB1], [1, %BB2] |
| 19 | ret int %Ret |
| 20 | end |