New testcase for instcombine
[oota-llvm.git] / test / Transforms / InstCombine / or.ll
1 ; This test makes sure that these instructions are properly eliminated.
2 ;
3
4 ; RUN: if as < %s | opt -instcombine | dis | grep or
5 ; RUN: then exit 1
6 ; RUN: else exit 0
7 ; RUN: fi
8
9 implementation
10
11 int "test1"(int %A) {
12         %B = or int %A, 0
13         ret int %B
14 }
15
16 int "test2"(int %A) {
17         %B = or int %A, -1
18         ret int %B
19 }
20
21 bool "test3"(bool %A) {
22         %B = or bool %A, false
23         ret bool %B
24 }
25
26 bool "test4"(bool %A) {
27         %B = or bool %A, true
28         ret bool %B
29 }
30
31 bool "test5"(bool %A) {
32         %B = xor bool %A, false
33         ret bool %B
34 }
35
36 int "test6"(int %A) {
37         %B = xor int %A, 0
38         ret int %B
39 }
40
41 bool "test7"(bool %A) {
42         %B = xor bool %A, %A
43         ret bool %B
44 }
45
46 int "test8"(int %A) {
47         %B = xor int %A, %A
48         ret int %B
49 }
50
51 bool "test9"(bool %A) {
52         %B = or bool %A, %A
53         ret bool %B
54 }
55
56 int "test10"(int %A) {
57         %B = or int %A, %A
58         ret int %B
59 }
60