blob: cad7a5aafda66f7213fcc765032c457746cda5a7 [file] [log] [blame]
Chris Lattner557a1432002-05-08 21:34:22 +00001; With reassociation, constant folding can eliminate the 12 and -12 constants.
2;
Chris Lattner50e86822003-06-28 23:23:34 +00003; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep add
Chris Lattner557a1432002-05-08 21:34:22 +00004
Chris Lattner50e86822003-06-28 23:23:34 +00005int %test(int %arg) {
Chris Lattner557a1432002-05-08 21:34:22 +00006 %tmp1 = sub int -12, %arg
7 %tmp2 = add int %tmp1, 12
8 ret int %tmp2
9}