blob: a7ff84a65e6a8cfdc58a4249ea1c2e05531825d2 [file] [log] [blame]
Chris Lattner557a1432002-05-08 21:34:22 +00001; With reassociation, constant folding can eliminate the 12 and -12 constants.
2;
Reid Spencer69ccadd2006-12-02 04:23:10 +00003; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -die | llvm-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}