       |/*
       |PERMUTE_ARGS:
       |REQUIRED_ARGS: -cov
       |POST_SCRIPT: runnable/extra-files/coverage-postscript.sh
       |EXECUTE_ARGS: ${RESULTS_DIR}/runnable
       |RUN_OUTPUT:
       |---
       |10 iterations
       |1899 primes
       |---
       |*/
       |
       |/* Eratosthenes Sieve prime number calculation. */
       |
       |import core.stdc.stdio;
       |
       |bool[8191] flags;
       |
       |int sieve()
       |{
      1|    int count;
       |
      1|    printf("10 iterations\n");
     22|    for (int iter = 1; iter <= 10; iter++)
       |    {
     10|        count = 0;
     10|        flags[] = true;
 163840|        for (int i = 0; i < flags.length; i++)
       |        {
  81910|            if (flags[i])
       |            {
  18990|                int prime = i + i + 3;
  18990|                int k = i + prime;
 168980|                while (k < flags.length)
       |                {
 149990|                    flags[k] = false;
 149990|                    k += prime;
       |                }
  18990|                count += 1;
       |            }
       |        }
       |    }
      1|    printf("%d primes\n", count);
      1|    return 0;
       |}
       |
       |extern(C) void dmd_coverDestPath(string path);
       |
       |int main(string[] args)
       |{
       |
      1|    dmd_coverDestPath(args[1]);
       |
      1|    sieve();
       |
      1|    return 0;
       |}
