PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / bitfld-4.c
blob13a5c691dd2185edcda2573bf3191da2cae4c871
1 /* When comparisons of bit-fields to unsigned constants got shortened,
2 the shortened signed constant was wrongly marked as overflowing,
3 leading to a later integer_zerop failure and misoptimization.
5 Related to bug tree-optimization/16437 but shows the problem on
6 32-bit systems. */
7 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
9 /* { dg-require-effective-target int32plus } */
11 extern void abort (void);
13 struct s { int a:12, b:20; };
15 struct s x = { -123, -456 };
17 int
18 main (void)
20 if (x.a != -123U || x.b != -456U)
21 abort ();
22 return 0;