aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr107465.c
blob: 7c9ff24bc83b98bbf8a5abe9100473b45ddbe076 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR c/107465 */
/* { dg-do compile } */
/* { dg-options "-Wsign-compare" } */

void baz (void);
typedef unsigned short T;

#if __SIZEOF_SHORT__ * __CHAR_BIT__ == 16
void
foo (unsigned short x)
{
  if (!(x ^ 0xFFFF))
    baz ();
}

void
bar (T x)
{
  if (!(x ^ 0xFFFF))	/* { dg-bogus "promoted bitwise complement of an unsigned value is always nonzero" } */
    baz ();
}
#endif