(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
ipa/
pr70646.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O2 -fno-unit-at-a-time" } */
       3  
       4  typedef unsigned char u8;
       5  typedef unsigned long long u64;
       6  
       7  static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p)
       8  {
       9   return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) & (u64)0x00000000000000ffULL) << 56) | (((u64)(*p) & (u64)0x000000000000ff00ULL) << 40) | (((u64)(*p) & (u64)0x0000000000ff0000ULL) << 24) | (((u64)(*p) & (u64)0x00000000ff000000ULL) << 8) | (((u64)(*p) & (u64)0x000000ff00000000ULL) >> 8) | (((u64)(*p) & (u64)0x0000ff0000000000ULL) >> 24) | (((u64)(*p) & (u64)0x00ff000000000000ULL) >> 40) | (((u64)(*p) & (u64)0xff00000000000000ULL) >> 56))) : __builtin_bswap64(*p));
      10  }
      11  
      12  static inline u64 wwn_to_u64(void *wwn)
      13  {
      14   return __swab64p(wwn);
      15  }
      16  
      17  void __attribute__((noinline,noclone)) broken(u64* shost)
      18  {
      19   u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
      20   *shost = wwn_to_u64(node_name);
      21  }
      22  
      23  void __attribute__((noinline,noclone)) dummy(void)
      24  {
      25   __builtin_abort();
      26  }
      27  
      28  int main(int argc, char* argv[])
      29  {
      30   u64 v;
      31  
      32   broken(&v);
      33  
      34   if(v != (u64)-1)
      35    __builtin_abort();
      36  
      37   return 0;
      38  }