New testcase for bug
[oota-llvm.git] / test / Transforms / InstCombine / set.ll
1 ; This test makes sure that these instructions are properly eliminated.
2 ;
3
4 ; RUN: if as < %s | opt -instcombine -dce | dis | grep set
5 ; RUN: then exit 1
6 ; RUN: else exit 0
7 ; RUN: fi
8
9 %X = uninitialized global int
10
11 bool "test1"(int %A) {
12         %B = seteq int %A, %A
13         %C = seteq int* %X, null   ; Never true
14         %D = and bool %B, %C
15         ret bool %D
16 }
17
18 bool "test2"(int %A) {
19         %B = setne int %A, %A
20         %C = setne int* %X, null   ; Never false
21         %D = or bool %B, %C
22         ret bool %D
23 }
24
25 bool "test3"(int %A) {
26         %B = setlt int %A, %A
27         ret bool %B
28 }
29
30 bool "test4"(int %A) {
31         %B = setgt int %A, %A
32         ret bool %B
33 }
34
35 bool "test5"(int %A) {
36         %B = setle int %A, %A
37         ret bool %B
38 }
39
40 bool "test6"(int %A) {
41         %B = setge int %A, %A
42         ret bool %B
43 }