diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2006-09-08 15:43:41 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2006-09-08 15:43:41 +0000 |
commit | a5b33dcab2e6218e9e17f36a26520fd1dabc58bb (patch) | |
tree | 93f6b4595b7ba079ed3517b7bc07e50c3049adcf /test/c/integr.c | |
parent | 43b4d97a655e52e3962c0d14bda39dacb24af901 (diff) | |
download | compcert-a5b33dcab2e6218e9e17f36a26520fd1dabc58bb.tar.gz compcert-a5b33dcab2e6218e9e17f36a26520fd1dabc58bb.zip |
MAJ des tests C
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@86 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/c/integr.c')
-rw-r--r-- | test/c/integr.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/c/integr.c b/test/c/integr.c index abcbd28d..25337dc4 100644 --- a/test/c/integr.c +++ b/test/c/integr.c @@ -1,3 +1,6 @@ +#include <stdlib.h> +#include <stdio.h> + static double square(double x) { return x * x; @@ -19,5 +22,11 @@ double test(int n) return integr(square, 0.0, 1.0, n); } - - +int main(int argc, char ** argv) +{ + int n; double r; + if (argc >= 2) n = atoi(argv[1]); else n = 10000; + r = test(n); + printf("integr(square, 0.0, 1.0, %d) = %g\n", n, r); + return 0; +} |