2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr60087.c
blobc6cf7aa460757d9d4e5684b01c19eb8c03fbbe21
1 /* PR c/60087 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wsign-compare" } */
5 void
6 foo (unsigned int ui, int i)
8 const unsigned char uc = 0;
9 _Bool b;
10 b = 0 != ~uc; /* { dg-warning "9:promoted ~unsigned is always non-zero" } */
11 b = 2 != ~uc; /* { dg-warning "9:comparison of promoted ~unsigned with constant" } */
12 b = uc == ~uc; /* { dg-warning "10:comparison of promoted ~unsigned with unsigned" } */
13 b = i == ui; /* { dg-warning "9:comparison of integer expressions of different signedness" } */