modernc.org/cc@v1.0.1/testdata/gcc-6.3.0/gcc/testsuite/gcc.c-torture/execute/pr67781.c (about)

     1  #ifdef __UINT32_TYPE__
     2  typedef __UINT32_TYPE__ uint32_t;
     3  #else
     4  typedef unsigned uint32_t;
     5  #endif
     6  
     7  #ifdef __UINT8_TYPE__
     8  typedef __UINT8_TYPE__ uint8_t;
     9  #else
    10  typedef unsigned char uint8_t;
    11  #endif
    12  
    13  struct
    14  {
    15    uint32_t a;
    16    uint8_t b;
    17  } s = { 0x123456, 0x78 };
    18  
    19  int pr67781()
    20  {
    21    uint32_t c = (s.a << 8) | s.b;
    22    return c;
    23  }
    24  
    25  int
    26  main ()
    27  {
    28    if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
    29      return 0;
    30  
    31    if (pr67781 () != 0x12345678)
    32      __builtin_abort ();
    33    return 0;
    34  }