comparison gcc/testsuite/gcc.dg/tree-ssa/popcount2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fno-tree-ch -fdump-tree-optimized" } */
3
4 int
5 __attribute__ ((noinline, noclone))
6 foo (long b)
7 {
8 int c = 0;
9
10 while (b) {
11 b &= b - 1;
12 c++;
13 }
14 return c;
15 }
16
17 int main()
18 {
19 if (foo (7) != 3)
20 __builtin_abort ();
21 if (foo (0) != 0)
22 __builtin_abort ();
23 if (foo (0xff) != 8)
24 __builtin_abort ();
25 return 0;
26 }
27
28 /* { dg-final { scan-tree-dump-times "__builtin_popcount" 1 "optimized" } } */