diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-07-24 16:09:47 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-07-24 16:09:47 +0200 |
commit | 04941b3cb8712cee9c3b0806cfe7aa76287c40e8 (patch) | |
tree | 54f8cb441d348c3c06821ff288086d2cde19c9a2 /test/c/fft.c | |
parent | 8a9bb1e699d62a8b5c88a54440ee2149acf7021a (diff) | |
download | compcert-04941b3cb8712cee9c3b0806cfe7aa76287c40e8.tar.gz compcert-04941b3cb8712cee9c3b0806cfe7aa76287c40e8.zip |
Updates to the local test suite
- Adjust parameters to bring the running time of each test closer to 1 second
- compression/arcode.c: array access one past
- "inline" -> "static inline"
- Remove cchecklink support
Diffstat (limited to 'test/c/fft.c')
-rw-r--r-- | test/c/fft.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/test/c/fft.c b/test/c/fft.c index 884a8568..a4755044 100644 --- a/test/c/fft.c +++ b/test/c/fft.c @@ -143,13 +143,13 @@ int dfft(double x[], double y[], int np) /* Test harness */ -double * xr, * xi; +#define NRUNS 20 int main(int argc, char ** argv) { - int n, np, npm, n2, i, j; + int n, np, npm, n2, i, j, nruns; double enp, t, y, z, zr, zi, zm, a; - double * pxr, * pxi; + double * xr, * xi, * pxr, * pxi; if (argc >= 2) n = atoi(argv[1]); else n = 18; np = 1 << n; @@ -160,21 +160,23 @@ int main(int argc, char ** argv) xi = calloc(np, sizeof(double)); pxr = xr; pxi = xi; - *pxr = (enp - 1.0) * 0.5; - *pxi = 0.0; - n2 = np / 2; - *(pxr+n2) = -0.5; - *(pxi+n2) = 0.0; - for (i = 1; i <= npm; i++) { - j = np - i; - *(pxr+i) = -0.5; - *(pxr+j) = -0.5; - z = t * (double)i; - y = -0.5*(cos(z)/sin(z)); - *(pxi+i) = y; - *(pxi+j) = -y; + for (nruns = 0; nruns < NRUNS; nruns++) { + *pxr = (enp - 1.0) * 0.5; + *pxi = 0.0; + n2 = np / 2; + *(pxr+n2) = -0.5; + *(pxi+n2) = 0.0; + for (i = 1; i <= npm; i++) { + j = np - i; + *(pxr+i) = -0.5; + *(pxr+j) = -0.5; + z = t * (double)i; + y = -0.5*(cos(z)/sin(z)); + *(pxi+i) = y; + *(pxi+j) = -y; + } + dfft(xr,xi,np); } - dfft(xr,xi,np); zr = 0.0; zi = 0.0; npm = np-1; |