Lines Matching full:unsigned
7 int test0(long a, unsigned long b) { in test0()
13 … (a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs}} in test0()
14 (a == (unsigned int) b) + in test0()
15 (a == (unsigned short) b) + in test0()
16 (a == (unsigned char) b) + in test0()
21 …((long) a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs… in test0()
22 … ((int) a == (unsigned int) b) + // expected-warning {{comparison of integers of different signs}} in test0()
23 ((short) a == (unsigned short) b) + in test0()
24 ((signed char) a == (unsigned char) b) + in test0()
25 … (a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}} in test0()
26 (a < (unsigned int) b) + in test0()
27 (a < (unsigned short) b) + in test0()
28 (a < (unsigned char) b) + in test0()
33 …((long) a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}} in test0()
34 … ((int) a < (unsigned int) b) + // expected-warning {{comparison of integers of different signs}} in test0()
35 ((short) a < (unsigned short) b) + in test0()
36 ((signed char) a < (unsigned char) b) + in test0()
39 (A == (unsigned long) b) + in test0()
40 (A == (unsigned int) b) + in test0()
41 (A == (unsigned short) b) + in test0()
42 (A == (unsigned char) b) + in test0()
47 ((long) A == (unsigned long) b) + in test0()
48 ((int) A == (unsigned int) b) + in test0()
49 ((short) A == (unsigned short) b) + in test0()
50 ((signed char) A == (unsigned char) b) + in test0()
51 (A < (unsigned long) b) + in test0()
52 (A < (unsigned int) b) + in test0()
53 (A < (unsigned short) b) + in test0()
54 (A < (unsigned char) b) + in test0()
59 ((long) A < (unsigned long) b) + in test0()
60 ((int) A < (unsigned int) b) + in test0()
61 ((short) A < (unsigned short) b) + in test0()
62 ((signed char) A < (unsigned char) b) + in test0()
65 (a == (unsigned long) B) + in test0()
66 (a == (unsigned int) B) + in test0()
67 (a == (unsigned short) B) + in test0()
68 (a == (unsigned char) B) + in test0()
73 ((long) a == (unsigned long) B) + in test0()
74 ((int) a == (unsigned int) B) + in test0()
75 ((short) a == (unsigned short) B) + in test0()
76 ((signed char) a == (unsigned char) B) + in test0()
77 …(a < (unsigned long) B) + // expected-warning {{comparison of unsigned expression < 0 is always f… in test0()
78 (a < (unsigned int) B) + in test0()
79 (a < (unsigned short) B) + in test0()
80 (a < (unsigned char) B) + in test0()
85 …((long) a < (unsigned long) B) + // expected-warning {{comparison of unsigned expression < 0 is a… in test0()
86 …((int) a < (unsigned int) B) + // expected-warning {{comparison of unsigned expression < 0 is alw… in test0()
87 ((short) a < (unsigned short) B) + in test0()
88 ((signed char) a < (unsigned char) B) + in test0()
91 (C == (unsigned long) b) + in test0()
92 (C == (unsigned int) b) + in test0()
93 …(C == (unsigned short) b) + // expected-warning {{comparison of constant 'C' (65536) with expressi… in test0()
94 …(C == (unsigned char) b) + // expected-warning {{comparison of constant 'C' (65536) with expressi… in test0()
99 ((long) C == (unsigned long) b) + in test0()
100 ((int) C == (unsigned int) b) + in test0()
101 ((short) C == (unsigned short) b) + in test0()
102 ((signed char) C == (unsigned char) b) + in test0()
103 (C < (unsigned long) b) + in test0()
104 (C < (unsigned int) b) + in test0()
105 …(C < (unsigned short) b) + // expected-warning {{comparison of constant 'C' (65536) with expressio… in test0()
106 …(C < (unsigned char) b) + // expected-warning {{comparison of constant 'C' (65536) with expression… in test0()
111 ((long) C < (unsigned long) b) + in test0()
112 ((int) C < (unsigned int) b) + in test0()
113 ((short) C < (unsigned short) b) + in test0()
114 ((signed char) C < (unsigned char) b) + in test0()
117 (a == (unsigned long) C) + in test0()
118 (a == (unsigned int) C) + in test0()
119 (a == (unsigned short) C) + in test0()
120 (a == (unsigned char) C) + in test0()
125 ((long) a == (unsigned long) C) + in test0()
126 ((int) a == (unsigned int) C) + in test0()
127 ((short) a == (unsigned short) C) + in test0()
128 ((signed char) a == (unsigned char) C) + in test0()
129 … (a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}} in test0()
130 (a < (unsigned int) C) + in test0()
131 (a < (unsigned short) C) + in test0()
132 (a < (unsigned char) C) + in test0()
137 …((long) a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}} in test0()
138 … ((int) a < (unsigned int) C) + // expected-warning {{comparison of integers of different signs}} in test0()
139 ((short) a < (unsigned short) C) + in test0()
140 ((signed char) a < (unsigned char) C) + in test0()
143 (0x80000 == (unsigned long) b) + in test0()
144 (0x80000 == (unsigned int) b) + in test0()
145 …(0x80000 == (unsigned short) b) + // expected-warning {{comparison of constant 524288 with express… in test0()
146 …(0x80000 == (unsigned char) b) + // expected-warning {{comparison of constant 524288 with expressi… in test0()
151 ((long) 0x80000 == (unsigned long) b) + in test0()
152 ((int) 0x80000 == (unsigned int) b) + in test0()
153 ((short) 0x80000 == (unsigned short) b) + in test0()
154 ((signed char) 0x80000 == (unsigned char) b) + in test0()
155 (0x80000 < (unsigned long) b) + in test0()
156 (0x80000 < (unsigned int) b) + in test0()
157 …(0x80000 < (unsigned short) b) + // expected-warning {{comparison of constant 524288 with expressi… in test0()
158 …(0x80000 < (unsigned char) b) + // expected-warning {{comparison of constant 524288 with expressio… in test0()
163 ((long) 0x80000 < (unsigned long) b) + in test0()
164 ((int) 0x80000 < (unsigned int) b) + in test0()
165 ((short) 0x80000 < (unsigned short) b) + in test0()
166 ((signed char) 0x80000 < (unsigned char) b) + in test0()
169 (a == (unsigned long) 0x80000) + in test0()
170 (a == (unsigned int) 0x80000) + in test0()
171 (a == (unsigned short) 0x80000) + in test0()
172 (a == (unsigned char) 0x80000) + in test0()
177 ((long) a == (unsigned long) 0x80000) + in test0()
178 ((int) a == (unsigned int) 0x80000) + in test0()
179 ((short) a == (unsigned short) 0x80000) + in test0()
180 ((signed char) a == (unsigned char) 0x80000) + in test0()
181 … (a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different signs}} in test0()
182 (a < (unsigned int) 0x80000) + in test0()
183 (a < (unsigned short) 0x80000) + in test0()
184 (a < (unsigned char) 0x80000) + in test0()
189 …((long) a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different … in test0()
190 …((int) a < (unsigned int) 0x80000) + // expected-warning {{comparison of integers of different si… in test0()
191 ((short) a < (unsigned short) 0x80000) + in test0()
192 ((signed char) a < (unsigned char) 0x80000) + in test0()
213 static const unsigned int kMax = 0;
221 unsigned long a; in test3()
224 (void) (true ? (unsigned int)a : (signed int)b); in test3()
226 (void) (true ? (unsigned char)b : (signed char)a); in test3()
229 // Test comparison of short to unsigned. If tautological compare does not
233 // All negative shorts are cast towards the max unsigned range. Relation in test4()
235 const unsigned A = 32768; in test4()
236 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
237 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
238 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
239 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
244 // When negative one is converted to an unsigned value, it becomes the max in test4()
245 // unsigned. Likewise, a negative one short can also be converted to max in test4()
246 // unsigned. in test4()
247 const unsigned B = -1; in test4()
248 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
251 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
252 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
253 … // expected-warning{{comparison of integers of different signs: 'short' and 'const unsigned int'}} in test4()
304 void test7(unsigned long other) { in test7()
305 // Common unsigned, other unsigned, constant unsigned in test7()
306 (void)((unsigned)other != (unsigned long)(0x1ffffffff)); // expected-warning{{true}} in test7()
307 (void)((unsigned)other != (unsigned long)(0xffffffff)); in test7()
308 (void)((unsigned long)other != (unsigned)(0x1ffffffff)); in test7()
309 (void)((unsigned long)other != (unsigned)(0xffffffff)); in test7()
311 // Common unsigned, other signed, constant unsigned in test7()
312 (void)((int)other != (unsigned long)(0xffffffffffffffff)); // expected-warning{{different signs}} in test7()
313 (void)((int)other != (unsigned long)(0x00000000ffffffff)); // expected-warning{{true}} in test7()
314 (void)((int)other != (unsigned long)(0x000000000fffffff)); in test7()
315 (void)((int)other < (unsigned long)(0x00000000ffffffff)); // expected-warning{{different signs}} in test7()
316 (void)((int)other == (unsigned)(0x800000000)); in test7()
318 // Common unsigned, other unsigned, constant signed in test7()
319 (void)((unsigned long)other != (int)(0xffffffff)); // expected-warning{{different signs}} in test7()
321 // Common unsigned, other signed, constant signed in test7()
330 // Common signed, other signed, constant unsigned in test7()
331 (void)((int)other != (unsigned char)(0xffff)); in test7()
332 (void)((int)other != (unsigned char)(0xff)); in test7()
334 // Common signed, other unsigned, constant signed in test7()
335 (void)((unsigned char)other != (int)(0xff)); in test7()
336 (void)((unsigned char)other != (int)(0xffff)); // expected-warning{{true}} in test7()
338 // Common signed, other unsigned, constant unsigned in test7()
339 (void)((unsigned char)other != (unsigned short)(0xff)); in test7()
340 (void)((unsigned char)other != (unsigned short)(0x100)); // expected-warning{{true}} in test7()
341 (void)((unsigned short)other != (unsigned char)(0xff)); in test7()
392 inline bool less_than_zero(unsigned num) { in less_than_zero()
395 return num < 0; // expected-warning{{comparison of unsigned expression < 0 is always false}} in less_than_zero()
398 void test11(unsigned num) { in test11()
405 template<unsigned n> bool compare(unsigned k) { return k >= n; } in compare()