blob: be204e92142d8dd65889d8e134af3d475c02fa52 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; With sub reassociation, constant folding can eliminate all of the constants.
2;
3; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -constprop -instcombine -dce | llvm-dis | not grep add
4
5int %test(int %A, int %B) {
6 %W = add int 5, %B
7 %X = add int -7, %A
8 %Y = sub int %X, %W
9 %Z = add int %Y, 12
10 ret int %Z
11}