Add some simple test of reassociation
[oota-llvm.git] / test / Transforms / Reassociate / basictest2.ll
1 ; With reassociation, constant folding can eliminate the +/- 30 constants.
2 ;
3 ; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 30
4 ; RUN: then exit 1
5 ; RUN: else exit 0
6 ; RUN: fi
7
8 int "test"(int %reg109, int %reg1111) {
9         %reg115 = add int %reg109, -30           ; <int> [#uses=1]
10         %reg116 = add int %reg115, %reg1111             ; <int> [#uses=1]
11         %reg117 = add int %reg116, 30           ; <int> [#uses=1]
12         ret int %reg117
13 }