blob: 6372d988c334e0f78fb0c7f294fb913088caa104 [file] [log] [blame]
Chris Lattner5a2dbc22002-05-08 21:34:22 +00001; With 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 add
Chris Lattner5a2dbc22002-05-08 21:34:22 +00004
Chris Lattnera6fee9d2003-06-28 23:23:34 +00005int %test(int %arg) {
Chris Lattner5a2dbc22002-05-08 21:34:22 +00006 %tmp1 = sub int -12, %arg
7 %tmp2 = add int %tmp1, 12
8 ret int %tmp2
9}