From a5b33dcab2e6218e9e17f36a26520fd1dabc58bb Mon Sep 17 00:00:00 2001 From: xleroy Date: Fri, 8 Sep 2006 15:43:41 +0000 Subject: MAJ des tests C git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@86 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/c/integr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/c/integr.c') diff --git a/test/c/integr.c b/test/c/integr.c index abcbd28..25337dc 100644 --- a/test/c/integr.c +++ b/test/c/integr.c @@ -1,3 +1,6 @@ +#include +#include + 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; +} -- cgit v1.2.3