Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/fold-popcount-4.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_shiftmax(unsigned int a) | |
5 { | |
6 return __builtin_popcount(a>>(8*sizeof(a)-1)); | |
7 } | |
8 | |
9 int test_shiftmaxl(unsigned long b) | |
10 { | |
11 return __builtin_popcountl(b>>(8*sizeof(b)-1)); | |
12 } | |
13 | |
14 int test_shiftmaxll(unsigned long long c) | |
15 { | |
16 return __builtin_popcountll(c>>(8*sizeof(c)-1)); | |
17 } | |
18 | |
19 int test_shift7(unsigned char d) | |
20 { | |
21 return __builtin_popcount(d>>7); | |
22 } | |
23 | |
24 int test_shift7l(unsigned char e) | |
25 { | |
26 return __builtin_popcountl(e>>7); | |
27 } | |
28 | |
29 int test_shift7ll(unsigned char f) | |
30 { | |
31 return __builtin_popcountll(f>>7); | |
32 } | |
33 | |
34 int test_shift15(unsigned short g) | |
35 { | |
36 return __builtin_popcount(g>>15); | |
37 } | |
38 | |
39 int test_shift15l(unsigned short h) | |
40 { | |
41 return __builtin_popcountl(h>>15); | |
42 } | |
43 | |
44 int test_shift15ll(unsigned short i) | |
45 { | |
46 return __builtin_popcountll(i>>15); | |
47 } | |
48 | |
49 /* { dg-final { scan-tree-dump-times "popcount" 0 "cddce1" } } */ | |
50 |