Chris Lattner | 557a143 | 2002-05-08 21:34:22 +0000 | [diff] [blame] | 1 | ; With reassociation, constant folding can eliminate the 12 and -12 constants. |
| 2 | ; |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 3 | ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep add |
Chris Lattner | 557a143 | 2002-05-08 21:34:22 +0000 | [diff] [blame] | 4 | |
Chris Lattner | 50e8682 | 2003-06-28 23:23:34 +0000 | [diff] [blame] | 5 | int %test(int %arg) { |
Chris Lattner | 557a143 | 2002-05-08 21:34:22 +0000 | [diff] [blame] | 6 | %tmp1 = sub int -12, %arg |
| 7 | %tmp2 = add int %tmp1, 12 |
| 8 | ret int %tmp2 |
| 9 | } |