Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / InstCombine / shift-simplify.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | egrep 'shl|lshr|ashr' | wc -l | grep 3
2
3 int %test0(int %A, int %B, ubyte %C) {
4         %X = shl int %A, ubyte %C
5         %Y = shl int %B, ubyte %C
6         %Z = and int %X, %Y
7         ret int %Z
8 }
9
10 int %test1(int %A, int %B, ubyte %C) {
11         %X = lshr int %A, ubyte %C
12         %Y = lshr int %B, ubyte %C
13         %Z = or int %X, %Y
14         ret int %Z
15 }
16
17 int %test2(int %A, int %B, ubyte %C) {
18         %X = ashr int %A, ubyte %C
19         %Y = ashr int %B, ubyte %C
20         %Z = xor int %X, %Y
21         ret int %Z
22 }