1 ; This test makes sure that these instructions are properly eliminated.
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep icmp
6 %X = uninitialized global int
10 %C = seteq int* %X, null ; Never true
17 %C = setne int* %X, null ; Never false
42 bool %test7(uint %A) {
43 %B = setge uint %A, 0 ; true
47 bool %test8(uint %A) {
48 %B = setlt uint %A, 0 ; false
52 ;; test operations on boolean values these should all be eliminated$a
53 bool %test9(bool %A) {
54 %B = setlt bool %A, false ; false
57 bool %test10(bool %A) {
58 %B = setgt bool %A, true ; false
61 bool %test11(bool %A) {
62 %B = setle bool %A, true ; true
65 bool %test12(bool %A) {
66 %B = setge bool %A, false ; true
69 bool %test13(bool %A, bool %B) {
70 %C = setge bool %A, %B ; A | ~B
73 bool %test14(bool %A, bool %B) {
74 %C = seteq bool %A, %B ; ~(A ^ B)
78 bool %test16(uint %A) {
80 %C = seteq uint %B, 8 ; Is never true
84 bool %test17(ubyte %A) {
86 %C = seteq ubyte %B, 2 ; Always false
90 bool %test18(bool %C, int %a) {
92 br bool %C, label %endif, label %else
98 %b.0 = phi int [ 0, %entry ], [ 1, %else ]
99 %tmp.4 = setlt int %b.0, 123
103 bool %test19(bool %A, bool %B) {
104 %a = cast bool %A to int
105 %b = cast bool %B to int
106 %C = seteq int %a, %b
110 uint %test20(uint %A) {
112 %C = setne uint %B, 0
113 %D = cast bool %C to uint
117 int %test21(int %a) {
118 %tmp.6 = and int %a, 4
119 %not.tmp.7 = setne int %tmp.6, 0
120 %retval = cast bool %not.tmp.7 to int
124 bool %test22(uint %A, int %X) {
125 %B = and uint %A, 100663295
126 %C = setlt uint %B, 268435456
128 %Z = setgt int %Y, -1
133 int %test23(int %a) {
134 %tmp.1 = and int %a, 1
135 %tmp.2 = seteq int %tmp.1, 0
136 %tmp.3 = cast bool %tmp.2 to int ;; xor tmp1, 1
140 int %test24(uint %a) {
141 %tmp1 = and uint %a, 4
142 %tmp.1 = shr uint %tmp1, ubyte 2
143 %tmp.2 = seteq uint %tmp.1, 0
144 %tmp.3 = cast bool %tmp.2 to int ;; xor tmp1, 1
148 bool %test25(uint %A) {
150 %C = setgt uint %B, 2