(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr78103-3.c
       1  /* PR target/78103 */
       2  /* { dg-do compile { target { ! ia32 } } } */
       3  /* { dg-options "-O2 -mno-lzcnt" } */
       4  /* { dg-final { scan-assembler-not {\mmovl\M} } } */
       5  /* { dg-final { scan-assembler-not {\mmovslq\M} } } */
       6  /* { dg-final { scan-assembler-not {\mxor[lq]\M} } } */
       7  /* { dg-final { scan-assembler-not {\msubq\M} } } */
       8  /* { dg-final { scan-assembler {\m(leaq|addq|incq)\M} { target { ! x32 } } } } */
       9  /* { dg-final { scan-assembler {\m(leal|addl|incl)\M} { target x32 } } } */
      10  
      11  unsigned long long
      12  foo (unsigned int x)
      13  {
      14    return __CHAR_BIT__ * sizeof (unsigned int) - __builtin_clz (x);
      15  }
      16  
      17  unsigned long long
      18  bar (unsigned int x)
      19  {
      20    return __CHAR_BIT__ * sizeof (unsigned int) - 1 - __builtin_clz (x);
      21  }
      22  
      23  unsigned long long
      24  baz (unsigned long long x)
      25  {
      26    return __CHAR_BIT__ * sizeof (unsigned long long) - __builtin_clzll (x);
      27  }
      28  
      29  unsigned long long
      30  qux (unsigned long long x)
      31  {
      32    return __CHAR_BIT__ * sizeof (unsigned long long) - 1 - __builtin_clzll (x);
      33  }