comparison gcc/testsuite/gcc.dg/fold-popcount-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-cddce1" } */
3
4 int test_andone(unsigned int a)
5 {
6 return __builtin_popcount(a&1);
7 }
8
9 int test_andonel(unsigned long b)
10 {
11 return __builtin_popcountl(b&1);
12 }
13
14 int test_andonell(unsigned long long c)
15 {
16 return __builtin_popcountll(c&1);
17 }
18
19 int test_oneand(unsigned int d)
20 {
21 return __builtin_popcount(1&d);
22 }
23
24 int test_oneandl(unsigned long e)
25 {
26 return __builtin_popcountl(1&e);
27 }
28
29 int test_oneandll(unsigned long long f)
30 {
31 return __builtin_popcountll(1&f);
32 }
33
34 /* { dg-final { scan-tree-dump-times "popcount" 0 "cddce1" } } */
35