(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr55583.c
       1  /* { dg-do compile  } */
       2  /* { dg-options "-O2 -Wno-shift-count-overflow" } */
       3  /* { dg-final { scan-assembler-times {(?n)shrd[ql]?[\t ]*\$2} 4 { target { ! ia32 } } } } */
       4  /* { dg-final { scan-assembler-times {(?n)shrdl?[\t ]*\$2} 2 { target ia32 } } } */
       5  /* { dg-final { scan-assembler-times {(?n)shldl?[\t ]*\$2} 1 { target ia32 } } } */
       6  /* { dg-final { scan-assembler-times {(?n)shld[ql]?[\t ]*\$2} 2 { target { ! ia32 } } } } */
       7  
       8  typedef unsigned long  u64;
       9  typedef unsigned int   u32;
      10  typedef unsigned short u16;
      11  
      12  long  a, b;
      13  int   c, d;
      14  short e, f;
      15  const int n = 2;
      16  
      17  void test64r () { b = ((u64)b >> n) | (a << (64 - n)); }
      18  void test32r () { d = ((u32)d >> n) | (c << (32 - n)); }
      19  
      20  unsigned long  ua, ub;
      21  unsigned int   uc, ud;
      22  unsigned short ue, uf;
      23  
      24  void testu64l () { ub = (ub << n) | (ua >> (64 - n)); }
      25  void testu64r () { ub = (ub >> n) | (ua << (64 - n)); }
      26  void testu32l () { ud = (ud << n) | (uc >> (32 - n)); }
      27  void testu32r () { ud = (ud >> n) | (uc << (32 - n)); }