From 5b6c019a507688dfcf63b9ef54f7731137422ab5 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 10 Sep 2019 17:50:42 +0200 Subject: Starting to modify official CompCert tests to be passable with the simu --- test/c/fannkuch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/c/fannkuch.c') diff --git a/test/c/fannkuch.c b/test/c/fannkuch.c index 9cc7a693..ddaa7309 100644 --- a/test/c/fannkuch.c +++ b/test/c/fannkuch.c @@ -8,6 +8,7 @@ * $Id: fannkuch-gcc.code,v 1.33 2006/02/25 16:38:58 igouy-guest Exp $ */ +#include #include #include @@ -31,8 +32,11 @@ fannkuch( int n ) if( n < 1 ) return 0; perm = calloc(n, sizeof(*perm )); + assert(perm != NULL && "fannkuch: perm malloc failed"); perm1 = calloc(n, sizeof(*perm1)); + assert(perm != NULL && "fannkuch: perm1 malloc failed"); count = calloc(n, sizeof(*count)); + assert(perm != NULL && "fannkuch: count malloc failed"); for( i=0 ; i1) ? atoi(argv[1]) : 10; + int n = (argc>1) ? atoi(argv[1]) : 8; printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n)); return 0; -- cgit From 059664368a5f4ed036e87c0a5e0ed1fae1706f3d Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 13 Sep 2019 15:18:55 +0200 Subject: Reducing further the input size of the tests --- test/c/fannkuch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/c/fannkuch.c') diff --git a/test/c/fannkuch.c b/test/c/fannkuch.c index ddaa7309..6fb7912f 100644 --- a/test/c/fannkuch.c +++ b/test/c/fannkuch.c @@ -102,7 +102,7 @@ fannkuch( int n ) int main( int argc, char* argv[] ) { - int n = (argc>1) ? atoi(argv[1]) : 8; + int n = (argc>1) ? atoi(argv[1]) : 6; printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n)); return 0; -- cgit From 5ca4b192499ee4829aee1256a3bebf2318c68108 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Wed, 25 Sep 2019 14:37:23 +0200 Subject: Restored previous input sizes for other backends --- test/c/fannkuch.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/c/fannkuch.c') diff --git a/test/c/fannkuch.c b/test/c/fannkuch.c index 6fb7912f..befccd8d 100644 --- a/test/c/fannkuch.c +++ b/test/c/fannkuch.c @@ -102,7 +102,11 @@ fannkuch( int n ) int main( int argc, char* argv[] ) { +#ifdef __K1C__ int n = (argc>1) ? atoi(argv[1]) : 6; +#else + int n = (argc>1) ? atoi(argv[1]) : 10; +#endif printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n)); return 0; -- cgit