modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/bitfld-4.c (about)

     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.
     4  
     5     Related to bug tree-optimization/16437 but shows the problem on
     6     32-bit systems.  */
     7  /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
     8  
     9  /* { dg-require-effective-target int32plus } */
    10  
    11  extern void abort (void);
    12  
    13  struct s { int a:12, b:20; };
    14  
    15  struct s x = { -123, -456 };
    16  
    17  int
    18  main (void)
    19  {
    20    if (x.a != -123U || x.b != -456U)
    21      abort ();
    22    return 0;
    23  }