struct foo
{
_Bool a : 1;
- _Bool b : 2;
- _Bool c : 7;
} sf;
#define str(x) xstr(x)
abort ();
if (a != 1 || b != 0 || c != 1)
abort ();
- /* Casts to _Bool have a specified behaviour. */
+ /* Casts to _Bool have a specified behavior. */
if ((int)(_Bool)2 != 1)
abort ();
if ((int)(_Bool)0.2 != 1)
abort ();
if ((u |= 2) != 1)
abort ();
- /* ??? A bit queer, since this gets optimized to ((u = (u != 3)) != 1)
- early in semantic analysis, which then yields the warning below. */
- if ((u ^= 3) != 1) /* { dg-warning "always true due to limited range" } */
+ if ((u ^= 3) != 1)
abort ();
/* Test comma expressions. */
u = 1;
sf.a = 1;
if (sf.a != 1)
abort ();
- sf.b = 1;
- if (sf.b != 1)
- abort ();
- sf.c = 1;
- if (sf.c != 1)
- abort ();
sf.a = 0;
if (sf.a != 0)
abort ();
- sf.b = 0;
- if (sf.b != 0)
- abort ();
- sf.c = 0;
- if (sf.c != 0)
- abort ();
}
exit (0);
}