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

     1  /* See http://gcc.gnu.org/ml/gcc/2009-06/msg00072.html.  */
     2  
     3  extern void abort (void);
     4  
     5  struct s
     6  {
     7    unsigned long long a:2;
     8    unsigned long long b:40;
     9    unsigned long long c:22;
    10  };
    11  
    12  __attribute__ ((noinline)) void
    13  g (unsigned long long a, unsigned long long b)
    14  {
    15    asm ("");
    16    if (a != b)
    17      abort ();
    18  }
    19  
    20  __attribute__ ((noinline)) void
    21  f (struct s s, unsigned long long b)
    22  {
    23    asm ("");
    24    g (((unsigned long long) (s.b-8)) + 8, b);
    25  }
    26  
    27  int
    28  main ()
    29  {
    30    struct s s = {1, 10, 3};
    31    struct s t = {1, 2, 3};
    32    f (s, 10);
    33    f (t, 0x10000000002);
    34    return 0;
    35  }