repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
tree-ssa
/
popcount2.c
blob
9096c6bee04e27b6ec7e23fb86bc6b9a3e1f4406
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" } } */