1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep set
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