blob: 7df7bafb2562e4bcb9f659d93c7ac85b67f2ce34 [file] [log] [blame]
Chris Lattnerd88f3e82002-05-15 21:59:31 +00001; With sub reassociation, constant folding can eliminate all of the constants.
2;
3; RUN: if as < %s | opt -reassociate -constprop -instcombine -dce | dis | grep add
4; RUN: then exit 1
5; RUN: else exit 0
6; RUN: fi
7
8int "test"(int %A, int %B) {
Chris Lattnera5d9be12002-05-16 00:56:36 +00009 %W = add int 5, %B
Chris Lattnerd88f3e82002-05-15 21:59:31 +000010 %X = add int -7, %A
11 %Y = sub int %X, %W
12 %Z = add int %Y, 12
13 ret int %Z
14}