blob: 097c355aaa4e6dae8130d7aeb5c5221f87ccf7e0 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
2;
3; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -die | llvm-dis | not grep 12
4
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}