Change these tests to feed the assembly files to opt directly, instead
[oota-llvm.git] / test / Transforms / InstCombine / shift-sra.ll
1 ; RUN: opt %s -instcombine | llvm-dis | \
2 ; RUN:    grep {lshr i32} | count 2
3 ; RUN: opt %s -instcombine | llvm-dis | not grep ashr
4
5
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]
11         ret i32 %Z
12 }
13
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]
18         ret i32 %tmp5
19 }