Chris Lattner | 11d13fb | 2002-05-15 20:30:48 +0000 | [diff] [blame] | 1 | ; With sub 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 12 |
Chris Lattner | 11d13fb | 2002-05-15 20:30:48 +0000 | [diff] [blame] | 4 | |
5 | int "test"(int %A, int %B) { | ||||
6 | %X = add int -12, %A | ||||
7 | %Y = sub int %X, %B | ||||
8 | %Z = add int %Y, 12 | ||||
9 | ret int %Z | ||||
10 | } |