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 | ; | ||||
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 %arg) { | ||||
9 | %tmp1 = sub int -12, %arg | ||||
10 | %tmp2 = add int %tmp1, 12 | ||||
11 | ret int %tmp2 | ||||
12 | } |