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 sanitizer/85029
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.misc-tests
/
sieve.c
blob
de250e8e5a0c4633ce779c27430643b7df1ea4a6
1
2
#define TRUE 1
3
#define FALSE 0
4
#define SIZE 8190
5
6
char
flags
[
SIZE
+
1
];
7
8
main
()
9
{
10
register
int
i
,
prime
,
k
,
count
,
iter
;
11
for
(
iter
=
1
;
iter
<=
100
;
iter
++) {
12
count
=
0
;
13
for
(
i
=
0
;
i
<=
SIZE
;
i
++)
14
flags
[
i
]=
TRUE
;
15
for
(
i
=
0
;
i
<=
SIZE
;
i
++) {
16
if
(
flags
[
i
]) {
17
prime
=
i
+
i
+
3
;
18
for
(
k
=
i
+
prime
;
k
<=
SIZE
;
k
+=
prime
)
19
flags
[
k
]=
FALSE
;
20
count
++;
21
}
22
}
23
}
24
return
0
;
25
}
26