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

     1  struct foo
     2  {
     3    unsigned half:16;
     4    unsigned long whole:32 __attribute__ ((packed));
     5  };
     6  
     7  f (struct foo *q)
     8  {
     9    if (q->half != 0x1234)
    10      abort ();
    11    if (q->whole != 0x56789abcL)
    12      abort ();
    13  }
    14  
    15  main ()
    16  {
    17    struct foo bar;
    18  
    19    bar.half = 0x1234;
    20    bar.whole = 0x56789abcL;
    21    f (&bar);
    22    exit (0);
    23  }