1 /* { dg-do compile } */
2 /* { dg-require-effective-target popcountl } */
3 /* { dg-options "-O2 -fdump-tree-phiopt4 -fdump-tree-optimized" } */
4
5 int PopCount (long b) {
6 int c = 0;
7
8 while (b) {
9 b &= b - 1;
10 c++;
11 }
12 return c;
13 }
14
15 /* { dg-final { scan-tree-dump-times "__builtin_popcount|\\.POPCOUNT" 1 "optimized" } } */
16 /* { dg-final { scan-tree-dump-times "if" 0 "phiopt4" } } */