Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / popcount.c
bloba5ec3b34f962de8b5658e41082559d68c1101320
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-optimized -fno-tree-ch" } */
4 extern int foo (int);
6 int PopCount (long b) {
7 int c = 0;
8 b++;
10 while (b) {
11 b &= b - 1;
12 c++;
14 return c;
16 int PopCount2 (long b) {
17 int c = 0;
19 while (b) {
20 b &= b - 1;
21 c++;
23 foo (c);
24 return foo (c);
27 void PopCount3 (long b1) {
29 for (long i = 0; i < b1; ++i)
31 long b = i;
32 int c = 0;
33 while (b) {
34 b &= b - 1;
35 c++;
37 foo (c);
41 /* { dg-final { scan-tree-dump-times "__builtin_popcount" 3 "optimized" } } */