For PR1319:
[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 | \
4 ; RUN:   opt -reassociate -instcombine | llvm-dis > %t 
5 ; RUN: grep mul %t | wc -l | grep 2
6 ; RUN: grep add %t | wc -l | grep 1
7
8 int %test(int %A, int %B, int %C) {
9         %aa = mul int %A, %A
10         %aab = mul int %aa, %B
11
12         %ac = mul int %A, %C
13         %aac = mul int %ac, %A
14         %r = add int %aab, %aac
15         ret int %r
16 }