Use the llvm-upgrade program to upgrade llvm assembly.
[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 | opt -reassociate -instcombine | llvm-dis | grep shl | wc -l | grep 1 &&
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1
4
5 int %test(int %X, int %Y) {
6         %tmp.2 = shl int %X, ubyte 1            ; <int> [#uses=1]
7         %tmp.6 = shl int %Y, ubyte 1            ; <int> [#uses=1]
8         %tmp.4 = add int %tmp.6, %tmp.2         ; <int> [#uses=1]
9         ret int %tmp.4
10 }
11