6960b1df99136030c499d7d3305dc179ea3a4fe2
[oota-llvm.git] / test / Transforms / Reassociate / otherops.ll
1 ; Reassociation should apply to Add, Mul, And, Or, & Xor
2 ;
3 ; RUN: as < %s | opt -reassociate -constprop -instcombine -die | dis | not grep 12
4
5 int "test_mul"(int %arg) {
6         %tmp1 = mul int 12, %arg
7         %tmp2 = mul int %tmp1, 12
8         ret int %tmp2
9 }
10
11 int "test_and"(int %arg) {
12         %tmp1 = and int 14, %arg
13         %tmp2 = and int %tmp1, 14
14         ret int %tmp2
15 }
16
17 int "test_or"(int %arg) {
18         %tmp1 = or int 14, %arg
19         %tmp2 = or int %tmp1, 14
20         ret int %tmp2
21 }
22
23 int "test_xor"(int %arg) {
24         %tmp1 = xor int 12, %arg
25         %tmp2 = xor int %tmp1, 12
26         ret int %tmp2
27 }
28