• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:short

1 // Force x86-64 because some of our heuristics are actually based
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -std=…
12 … (a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs}} in test0()
14 (a == (unsigned short) b) + in test0()
16 ((long) a == b) + // expected-warning {{comparison of integers of different signs}} in test0()
17 ((int) a == b) + // expected-warning {{comparison of integers of different signs}} in test0()
18 ((short) a == b) + // expected-warning {{comparison of integers of different signs}} in test0()
19 ((signed char) a == b) + // expected-warning {{comparison of integers of different signs}} in test0()
20 …((long) a == (unsigned long) b) + // expected-warning {{comparison of integers of different signs… in test0()
21 … ((int) a == (unsigned int) b) + // expected-warning {{comparison of integers of different signs}} in test0()
22 ((short) a == (unsigned short) b) + in test0()
24 … (a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}} in test0()
26 (a < (unsigned short) b) + in test0()
28 ((long) a < b) + // expected-warning {{comparison of integers of different signs}} in test0()
29 ((int) a < b) + // expected-warning {{comparison of integers of different signs}} in test0()
30 ((short) a < b) + // expected-warning {{comparison of integers of different signs}} in test0()
31 ((signed char) a < b) + // expected-warning {{comparison of integers of different signs}} in test0()
32 …((long) a < (unsigned long) b) + // expected-warning {{comparison of integers of different signs}} in test0()
33 … ((int) a < (unsigned int) b) + // expected-warning {{comparison of integers of different signs}} in test0()
34 ((short) a < (unsigned short) b) + in test0()
40 (A == (unsigned short) b) + in test0()
44 ((short) A == b) + in test0()
48 ((short) A == (unsigned short) b) + in test0()
52 (A < (unsigned short) b) + in test0()
56 ((short) A < b) + in test0()
60 ((short) A < (unsigned short) b) + in test0()
66 (a == (unsigned short) B) + in test0()
70 ((short) a == B) + in test0()
74 ((short) a == (unsigned short) B) + in test0()
76 … (a < (unsigned long) B) + // expected-warning {{comparison of integers of different signs}} in test0()
78 (a < (unsigned short) B) + in test0()
82 ((short) a < B) + in test0()
84 …((long) a < (unsigned long) B) + // expected-warning {{comparison of integers of different signs}} in test0()
85 … ((int) a < (unsigned int) B) + // expected-warning {{comparison of integers of different signs}} in test0()
86 ((short) a < (unsigned short) B) + in test0()
92 …(C == (unsigned short) b) + // expected-warning {{comparison of constant 'C' (65536) with expressi… in test0()
93 …(C == (unsigned char) b) + // expected-warning {{comparison of constant 'C' (65536) with expressi… in test0()
96 ((short) C == b) + in test0()
100 ((short) C == (unsigned short) b) + in test0()
104 …(C < (unsigned short) b) + // expected-warning {{comparison of constant 'C' (65536) with expressio… in test0()
105 …(C < (unsigned char) b) + // expected-warning {{comparison of constant 'C' (65536) with expression… in test0()
108 ((short) C < b) + in test0()
112 ((short) C < (unsigned short) b) + in test0()
118 (a == (unsigned short) C) + in test0()
122 …((short) a == C) + // expected-warning {{comparison of constant 'C' (65536) with expression of typ… in test0()
123 …((signed char) a == C) + // expected-warning {{comparison of constant 'C' (65536) with expression … in test0()
126 ((short) a == (unsigned short) C) + in test0()
128 … (a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}} in test0()
130 (a < (unsigned short) C) + in test0()
134 …((short) a < C) + // expected-warning {{comparison of constant 'C' (65536) with expression of type… in test0()
135 …((signed char) a < C) + // expected-warning {{comparison of constant 'C' (65536) with expression o… in test0()
136 …((long) a < (unsigned long) C) + // expected-warning {{comparison of integers of different signs}} in test0()
137 … ((int) a < (unsigned int) C) + // expected-warning {{comparison of integers of different signs}} in test0()
138 ((short) a < (unsigned short) C) + in test0()
144 …(0x80000 == (unsigned short) b) + // expected-warning {{comparison of constant 524288 with express… in test0()
145 …(0x80000 == (unsigned char) b) + // expected-warning {{comparison of constant 524288 with expressi… in test0()
148 ((short) 0x80000 == b) + in test0()
152 ((short) 0x80000 == (unsigned short) b) + in test0()
156 …(0x80000 < (unsigned short) b) + // expected-warning {{comparison of constant 524288 with expressi… in test0()
157 …(0x80000 < (unsigned char) b) + // expected-warning {{comparison of constant 524288 with expressio… in test0()
160 ((short) 0x80000 < b) + in test0()
164 ((short) 0x80000 < (unsigned short) b) + in test0()
170 (a == (unsigned short) 0x80000) + in test0()
174 …((short) a == 0x80000) + // expected-warning {{comparison of constant 524288 with expression of ty… in test0()
175 …((signed char) a == 0x80000) + // expected-warning {{comparison of constant 524288 with expression… in test0()
178 ((short) a == (unsigned short) 0x80000) + in test0()
180 … (a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different signs}} in test0()
182 (a < (unsigned short) 0x80000) + in test0()
186 …((short) a < 0x80000) + // expected-warning {{comparison of constant 524288 with expression of typ… in test0()
187 …((signed char) a < 0x80000) + // expected-warning {{comparison of constant 524288 with expression … in test0()
188 …((long) a < (unsigned long) 0x80000) + // expected-warning {{comparison of integers of different … in test0()
189 …((int) a < (unsigned int) 0x80000) + // expected-warning {{comparison of integers of different si… in test0()
190 ((short) a < (unsigned short) 0x80000) + in test0()
204 …if (test1 == vp) { } // expected-warning{{equality comparison between function pointer and void po… in test2()
205 if (test1 == e) { } // expected-error{{comparison between pointer and integer}} in test2()
207 if (test1 < e) { } // expected-error{{comparison between pointer and integer}} in test2()
216 // -Wsign-compare should not warn when ?: operands have different signedness.
217 // This will be caught by -Wsign-conversion
227 // Test comparison of short to unsigned. If tautological compare does not
229 void test4(short s) { in test4()
230 // A is max short plus 1. All zero and positive shorts are smaller than it. in test4()
234 …void (s < A); // expected-warning{{comparison of integers of different signs: 'short' and 'const u… in test4()
235 …void (s > A); // expected-warning{{comparison of integers of different signs: 'short' and 'const u… in test4()
236 …void (s <= A); // expected-warning{{comparison of integers of different signs: 'short' and 'const … in test4()
237 …void (s >= A); // expected-warning{{comparison of integers of different signs: 'short' and 'const … in test4()
239 …void (s == A); // expected-warning{{comparison of constant 32768 with expression of type 'short' i… in test4()
240 …void (s != A); // expected-warning{{comparison of constant 32768 with expression of type 'short' i… in test4()
243 // unsigned. Likewise, a negative one short can also be converted to max in test4()
245 const unsigned B = -1; in test4()
246 …void (s < B); // expected-warning{{comparison of integers of different signs: 'short' and 'const u… in test4()
247 …void (s > B); // expected-warning{{comparison of integers of different signs: 'short' and 'const u… in test4()
248 …void (s <= B); // expected-warning{{comparison of integers of different signs: 'short' and 'const … in test4()
249 …void (s >= B); // expected-warning{{comparison of integers of different signs: 'short' and 'const … in test4()
250 …void (s == B); // expected-warning{{comparison of integers of different signs: 'short' and 'const … in test4()
251 …void (s != B); // expected-warning{{comparison of integers of different signs: 'short' and 'const … in test4()
256 …(void) (b < -1); // expected-warning{{comparison of constant -1 with expression of type 'bool' is … in test5()
257 …(void) (b > -1); // expected-warning{{comparison of constant -1 with expression of type 'bool' is … in test5()
258 …(void) (b == -1); // expected-warning{{comparison of constant -1 with expression of type 'bool' is… in test5()
259 …(void) (b != -1); // expected-warning{{comparison of constant -1 with expression of type 'bool' is… in test5()
260 …(void) (b <= -1); // expected-warning{{comparison of constant -1 with expression of type 'bool' is… in test5()
261 …(void) (b >= -1); // expected-warning{{comparison of constant -1 with expression of type 'bool' is… in test5()
263 …(void) (b < -10); // expected-warning{{comparison of constant -10 with expression of type 'bool' i… in test5()
264 …(void) (b > -10); // expected-warning{{comparison of constant -10 with expression of type 'bool' i… in test5()
265 …(void) (b == -10); // expected-warning{{comparison of constant -10 with expression of type 'bool' … in test5()
266 …(void) (b != -10); // expected-warning{{comparison of constant -10 with expression of type 'bool' … in test5()
267 …(void) (b <= -10); // expected-warning{{comparison of constant -10 with expression of type 'bool' … in test5()
268 …(void) (b >= -10); // expected-warning{{comparison of constant -10 with expression of type 'bool' … in test5()
270 …(void) (b < 2); // expected-warning{{comparison of constant 2 with expression of type 'bool' is al… in test5()
271 …(void) (b > 2); // expected-warning{{comparison of constant 2 with expression of type 'bool' is al… in test5()
272 …(void) (b == 2); // expected-warning{{comparison of constant 2 with expression of type 'bool' is a… in test5()
273 …(void) (b != 2); // expected-warning{{comparison of constant 2 with expression of type 'bool' is a… in test5()
274 …(void) (b <= 2); // expected-warning{{comparison of constant 2 with expression of type 'bool' is a… in test5()
275 …(void) (b >= 2); // expected-warning{{comparison of constant 2 with expression of type 'bool' is a… in test5()
277 …(void) (b < 10); // expected-warning{{comparison of constant 10 with expression of type 'bool' is … in test5()
278 …(void) (b > 10); // expected-warning{{comparison of constant 10 with expression of type 'bool' is … in test5()
279 …(void) (b == 10); // expected-warning{{comparison of constant 10 with expression of type 'bool' is… in test5()
280 …(void) (b != 10); // expected-warning{{comparison of constant 10 with expression of type 'bool' is… in test5()
281 …(void) (b <= 10); // expected-warning{{comparison of constant 10 with expression of type 'bool' is… in test5()
282 …(void) (b >= 10); // expected-warning{{comparison of constant 10 with expression of type 'bool' is… in test5()
286 …(void)(sc < 200); // expected-warning{{comparison of constant 200 with expression of type 'signed … in test6()
287 …(void)(sc > 200); // expected-warning{{comparison of constant 200 with expression of type 'signed … in test6()
288 …(void)(sc <= 200); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
289 …(void)(sc >= 200); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
290 …(void)(sc == 200); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
291 …(void)(sc != 200); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
293 …(void)(200 < sc); // expected-warning{{comparison of constant 200 with expression of type 'signed … in test6()
294 …(void)(200 > sc); // expected-warning{{comparison of constant 200 with expression of type 'signed … in test6()
295 …(void)(200 <= sc); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
296 …(void)(200 >= sc); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
297 …(void)(200 == sc); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
298 …(void)(200 != sc); // expected-warning{{comparison of constant 200 with expression of type 'signed… in test6()
304 (void)((unsigned)other != (unsigned long)(0x1ffffffff)); // expected-warning{{true}} in test7()
310 (void)((int)other != (unsigned long)(0xffffffffffffffff)); // expected-warning{{different signs}} in test7()
311 (void)((int)other != (unsigned long)(0x00000000ffffffff)); // expected-warning{{true}} in test7()
313 (void)((int)other < (unsigned long)(0x00000000ffffffff)); // expected-warning{{different signs}} in test7()
317 (void)((unsigned long)other != (int)(0xffffffff)); // expected-warning{{different signs}} in test7()
323 (void)((int)other != (long)(0xffffffff)); // expected-warning{{true}} in test7()
324 (void)((int)other != (long)(0xffffffff00000000)); // expected-warning{{true}} in test7()
334 (void)((unsigned char)other != (int)(0xffff)); // expected-warning{{true}} in test7()
337 (void)((unsigned char)other != (unsigned short)(0xff)); in test7()
338 (void)((unsigned char)other != (unsigned short)(0x100)); // expected-warning{{true}} in test7()
339 (void)((unsigned short)other != (unsigned char)(0xff)); in test7()
344 Negative = -1, in test8()
349 (void)((E)x == -1); in test8()
365 bool less_than_max(short num, T value) { in less_than_max()
371 bool less_than_max(short num) { in less_than_max()
374 …return num < max<int>(); // expected-warning{{comparison of constant 2147483647 with expression o… in less_than_max()
377 void test10(short num, int x) { in test10()
381 less_than_max<short>(num); in test10()
393 return num < 0; // expected-warning{{comparison of unsigned expression < 0 is always false}} in less_than_zero()
400 less_than_zero<short>(num); in test11()
416 A::x == otherA::x) // expected-warning{{self-comparison always evaluates to true}} in testx()