Modernize testcase
[oota-llvm.git] / test / Transforms / InstCombine / shift.ll
1 ; This test makes sure that these instructions are properly eliminated.
2 ;
3
4 ; RUN: if as < %s | opt -instcombine | dis | grep sh
5 ; RUN: then exit 1
6 ; RUN: else exit 0
7 ; RUN: fi
8
9 implementation
10
11 int %test1(int %A) {
12         %B = shl int %A, ubyte 0
13         ret int %B
14 }
15
16 int %test2(ubyte %A) {
17         %B = shl int 0, ubyte %A
18         ret int %B
19 }
20
21 int %test3(int %A) {
22         %B = shr int %A, ubyte 0
23         ret int %B
24 }
25
26 int %test4(ubyte %A) {
27         %B = shr int 0, ubyte %A
28         ret int %B
29 }
30
31 uint %test5(uint %A) {
32         %B = shr uint %A, ubyte 32  ;; shift all bits out
33         ret uint %B
34 }
35
36 uint %test6(uint %A) {
37         %B = shl uint %A, ubyte 1   ;; convert to an add instruction
38         ret uint %B
39 }
40
41 int %test7(ubyte %A) {
42         %B = shr int -1, ubyte %A   ;; Always equal to -1
43         ret int %B
44 }