For PR1319:
[oota-llvm.git] / test / Transforms / Reassociate / shift-factor.ll
1 ; There should be exactly one shift and one add left.
2 ; RUN: llvm-upgrade < %s | llvm-as | \
3 ; RUN:   opt -reassociate -instcombine | llvm-dis > %t  
4 ; RUN: grep shl %t | wc -l | grep 1
5 ; RUN: grep add %t | wc -l | grep 1
6
7 int %test(int %X, int %Y) {
8         %tmp.2 = shl int %X, ubyte 1            ; <int> [#uses=1]
9         %tmp.6 = shl int %Y, ubyte 1            ; <int> [#uses=1]
10         %tmp.4 = add int %tmp.6, %tmp.2         ; <int> [#uses=1]
11         ret int %tmp.4
12 }
13