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 | ; | ||||
3 | ; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep add | ||||
4 | ; RUN: then exit 1 | ||||
5 | ; RUN: else exit 0 | ||||
6 | ; RUN: fi | ||||
7 | |||||
8 | int "test"(int %A, int %B) { | ||||
9 | %X = add int -12, %A | ||||
10 | %Y = sub int %X, %B | ||||
11 | %Z = add int %Y, 12 | ||||
12 | ret int %Z | ||||
13 | } |