PR sanitizer/85029
[official-gcc.git] / gcc / testsuite / gcc.misc-tests / sieve.c
blobde250e8e5a0c4633ce779c27430643b7df1ea4a6
2 #define TRUE 1
3 #define FALSE 0
4 #define SIZE 8190
6 char flags[SIZE+1];
8 main()
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++;
24 return 0;