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

     1  /* PR tree-optimization/65215 */
     2  
     3  struct S { unsigned long long l1 : 48; };
     4  
     5  static inline unsigned int
     6  foo (unsigned int x)
     7  {
     8    return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24);
     9  }
    10  
    11  __attribute__((noinline, noclone)) unsigned int
    12  bar (struct S *x)
    13  {
    14    return foo (x->l1);
    15  }
    16  
    17  int
    18  main ()
    19  {
    20    if (__CHAR_BIT__ != 8 || sizeof (unsigned int) != 4 || sizeof (unsigned long long) != 8)
    21      return 0;
    22    struct S s;
    23    s.l1 = foo (0xdeadbeefU) | (0xfeedULL << 32);
    24    if (bar (&s) != 0xdeadbeefU)
    25      __builtin_abort ();
    26    return 0;
    27  }