aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr118637.c
blob: d612b1d906e0c81dc23a438cbf691ed67e2dab8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR tree-optimization/118637 */
/* { dg-do compile { target clz } } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times "__builtin_clz|\\.CLZ" 2 "optimized" } } */

__attribute__((noipa)) unsigned
foo (unsigned x)
{
  unsigned result = 0;
  while (x /= 2)
    ++result;
  return result;
}

__attribute__((noipa)) unsigned
bar (unsigned x)
{
  unsigned result = 0;
  while (x >>= 1)
    ++result;
  return result;
}