For PR1319:
[oota-llvm.git] / test / Transforms / Reassociate / mulfactor2.ll
1 ; This should turn into one multiply and one add.
2
3 ; RUN: llvm-upgrade < %s | llvm-as | \
4 ; RUN:   opt -instcombine -reassociate -instcombine | llvm-dis -o %t 
5 ; RUN: grep mul %t | wc -l | grep 1
6 ; RUN: grep add %t | wc -l | grep 1
7
8 int %main(int %t) {
9         %tmp.3 = mul int %t, 12         ; <int> [#uses=1]
10         %tmp.4 = add int %tmp.3, 5              ; <int> [#uses=1]
11         %tmp.6 = mul int %t, 6          ; <int> [#uses=1]
12         %tmp.8 = mul int %tmp.4, 3              ; <int> [#uses=1]
13         %tmp.9 = add int %tmp.8, %tmp.6         ; <int> [#uses=1]
14         ret int %tmp.9
15 }
16