1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
2 ; RUN: grep {lshr i32} | count 2
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr
6 define i32 @test1(i32 %X, i8 %A) {
7 %shift.upgrd.1 = zext i8 %A to i32 ; <i32> [#uses=1]
8 ; can be logical shift.
9 %Y = ashr i32 %X, %shift.upgrd.1 ; <i32> [#uses=1]
10 %Z = and i32 %Y, 1 ; <i32> [#uses=1]
14 define i32 @test2(i8 %tmp) {
15 %tmp3 = zext i8 %tmp to i32 ; <i32> [#uses=1]
16 %tmp4 = add i32 %tmp3, 7 ; <i32> [#uses=1]
17 %tmp5 = ashr i32 %tmp4, 3 ; <i32> [#uses=1]