Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / Reassociate / mul-factor3.ll
1 ; This should be one add and two multiplies.
2
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2 &&
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
5
6 int %test(int %A, int %B, int %C) {
7         %aa = mul int %A, %A
8         %aab = mul int %aa, %B
9
10         %ac = mul int %A, %C
11         %aac = mul int %ac, %A
12         %r = add int %aab, %aac
13         ret int %r
14 }