blob: fe2d46f910c89286017c23bb4a4c99dba8d5cee5 [file] [log] [blame]
Chris Lattner0743fbd2002-05-15 20:30:48 +00001; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
2;
Misha Brukmanedf4bab2003-09-16 15:29:54 +00003; RUN: llvm-as < %s | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12
Chris Lattner0743fbd2002-05-15 20:30:48 +00004
5int "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}