blob: 9b64966553613842a8d7d043e356be8f371c5d5b [file] [log] [blame]
Chris Lattner11d13fb2002-05-15 20:30:48 +00001; 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
8int "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}