aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-parity-1.c
blob: 3ba56c7fccb0b608259b47c02b0e5baa3bdd4819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */

int foo(unsigned int x)
{
  return __builtin_popcount(x) & 1;
}

int fool(unsigned long x)
{
  return __builtin_popcountl(x) & 1;
}

int fooll(unsigned long long x)
{
  return __builtin_popcountll(x) & 1;
}

/* { dg-final { scan-tree-dump-times "__builtin_popcount" 0 "original" } } */
/* { dg-final { scan-tree-dump-times "__builtin_parity" 3 "original" } } */