aboutsummaryrefslogtreecommitdiffstats
path: root/test/c
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-09-13 14:32:25 +0200
committerCyril SIX <cyril.six@kalray.eu>2019-09-13 14:32:25 +0200
commitf0f25eabe5b374f20a5db30f652f6e994fff3fb3 (patch)
treebbf790a23bc9a3f75195e7adc5505bfe80649a33 /test/c
parent70cc8540ed308d26b4c211a291fef66f942b8431 (diff)
downloadcompcert-kvx-f0f25eabe5b374f20a5db30f652f6e994fff3fb3.tar.gz
compcert-kvx-f0f25eabe5b374f20a5db30f652f6e994fff3fb3.zip
Scaling down most of c/ CompCert tests
Diffstat (limited to 'test/c')
-rw-r--r--test/c/Makefile15
-rw-r--r--test/c/Results/chomp4
-rw-r--r--test/c/Results/mandelbrotbin125013 -> 709 bytes
-rw-r--r--test/c/Results/nbody2
-rw-r--r--test/c/Results/nsieve6
-rw-r--r--test/c/Results/nsievebits6
-rw-r--r--test/c/Results/perlin2
-rw-r--r--test/c/Results/spectral2
-rw-r--r--test/c/Results/vmach4
-rw-r--r--test/c/chomp.c4
-rw-r--r--test/c/mandelbrot.c10
-rw-r--r--test/c/nbody.c2
-rw-r--r--test/c/nsieve.c2
-rw-r--r--test/c/nsievebits.c2
-rw-r--r--test/c/perlin.c9
-rw-r--r--test/c/qsort.c2
-rw-r--r--test/c/spectral.c2
-rw-r--r--test/c/vmach.c19
18 files changed, 56 insertions, 37 deletions
diff --git a/test/c/Makefile b/test/c/Makefile
index 9580c8cc..31bf3cd1 100644
--- a/test/c/Makefile
+++ b/test/c/Makefile
@@ -14,11 +14,16 @@ TIME=time >/dev/null # Otherwise
PROGS?=fib integr qsort fft fftsp fftw sha1 sha3 aes almabench \
lists binarytrees fannkuch mandelbrot nbody \
nsieve nsievebits spectral vmach \
- bisect chomp perlin siphash24
-
-# Kalray NOTE : removed knucleotide from PROGS, it is hard to edit the input
-# to modify its size without resulting in a seg fault, and the base input
-# takes a too long time to complete in the simulator.
+ chomp perlin siphash24
+
+##
+# Kalray NOTE :
+# * removed knucleotide from PROGS, it is hard to edit the input
+# to modify its size without resulting in a seg fault, and the base input
+# takes a too long time to complete in the simulator.
+# * also removed bisect, who is exhibiting different float values on the Kalray
+# architecture than using x86 GCC (for both CompCert and GCC ports) (tested with n=10)
+##
all: $(PROGS:%=%.compcert)
diff --git a/test/c/Results/chomp b/test/c/Results/chomp
index 145b603a..fb4d17a1 100644
--- a/test/c/Results/chomp
+++ b/test/c/Results/chomp
@@ -1,8 +1,4 @@
player 0 plays at (1,1)
-player 1 plays at (6,0)
-player 0 plays at (0,6)
-player 1 plays at (5,0)
-player 0 plays at (0,5)
player 1 plays at (4,0)
player 0 plays at (0,4)
player 1 plays at (3,0)
diff --git a/test/c/Results/mandelbrot b/test/c/Results/mandelbrot
index b81e96bf..e6eb3e50 100644
--- a/test/c/Results/mandelbrot
+++ b/test/c/Results/mandelbrot
Binary files differ
diff --git a/test/c/Results/nbody b/test/c/Results/nbody
index 41b648fd..e43de06f 100644
--- a/test/c/Results/nbody
+++ b/test/c/Results/nbody
@@ -1,2 +1,2 @@
-0.169075164
--0.169086185
+-0.169026909
diff --git a/test/c/Results/nsieve b/test/c/Results/nsieve
index bb9b87dc..69643235 100644
--- a/test/c/Results/nsieve
+++ b/test/c/Results/nsieve
@@ -1,3 +1,3 @@
-Primes up to 5120000 356244
-Primes up to 2560000 187134
-Primes up to 1280000 98610
+Primes up to 102400 9805
+Primes up to 51200 5239
+Primes up to 25600 2818
diff --git a/test/c/Results/nsievebits b/test/c/Results/nsievebits
index bb9b87dc..e2d08319 100644
--- a/test/c/Results/nsievebits
+++ b/test/c/Results/nsievebits
@@ -1,3 +1,3 @@
-Primes up to 5120000 356244
-Primes up to 2560000 187134
-Primes up to 1280000 98610
+Primes up to 80000 7837
+Primes up to 40000 4203
+Primes up to 20000 2262
diff --git a/test/c/Results/perlin b/test/c/Results/perlin
index 4503fc1c..1d3be5f8 100644
--- a/test/c/Results/perlin
+++ b/test/c/Results/perlin
@@ -1 +1 @@
--4.0543e+03
+-2.9375e+01
diff --git a/test/c/Results/spectral b/test/c/Results/spectral
index 1e35f7e0..2ad8d778 100644
--- a/test/c/Results/spectral
+++ b/test/c/Results/spectral
@@ -1 +1 @@
-1.274224148
+1.273394737
diff --git a/test/c/Results/vmach b/test/c/Results/vmach
index 9caa2e51..a95237a6 100644
--- a/test/c/Results/vmach
+++ b/test/c/Results/vmach
@@ -1,2 +1,2 @@
-fib(30) = 1346269
-tak(18, 12, 6) = 7
+fib(15) = 987
+tak(12, 9, 6) = 9
diff --git a/test/c/chomp.c b/test/c/chomp.c
index 728e7a01..a2d0d627 100644
--- a/test/c/chomp.c
+++ b/test/c/chomp.c
@@ -338,8 +338,8 @@ int main(void)
struct _play *tree;
- ncol = 7;
- nrow = 7;
+ ncol = 5;
+ nrow = 5;
tree = make_play(1); /* create entire tree structure, not just the */
player = 0; /* needed part for first move */
current = make_data(nrow,ncol); /* start play at full board */
diff --git a/test/c/mandelbrot.c b/test/c/mandelbrot.c
index 032e7d75..d2afcad1 100644
--- a/test/c/mandelbrot.c
+++ b/test/c/mandelbrot.c
@@ -22,7 +22,7 @@ int main (int argc, char **argv)
double Zr, Zi, Cr, Ci, Tr, Ti;
if (argc < 2) {
- w = h = 1000;
+ w = h = 50;
} else {
w = h = atoi(argv[1]);
}
@@ -51,14 +51,22 @@ int main (int argc, char **argv)
if(bit_num == 8)
{
+ printf("%c", byte_acc);
putc(byte_acc,stdout);
+#ifdef __K1C__ // stdout isn't flushed enough when --syscall=libstd_scalls.so is passed to the simulator k1-cluster
+ fflush(stdout);
+#endif
byte_acc = 0;
bit_num = 0;
}
else if(x == w-1)
{
byte_acc <<= (8-w%8);
+ printf("%c", byte_acc);
putc(byte_acc,stdout);
+#ifdef __K1C__ // stdout isn't flushed enough when --syscall=libstd_scalls.so is passed to the simulator k1-cluster
+ fflush(stdout);
+#endif
byte_acc = 0;
bit_num = 0;
}
diff --git a/test/c/nbody.c b/test/c/nbody.c
index 530c41fa..207184f7 100644
--- a/test/c/nbody.c
+++ b/test/c/nbody.c
@@ -140,7 +140,7 @@ void setup_bodies(void)
int main(int argc, char ** argv)
{
- int n = argc < 2 ? 1000000 : atoi(argv[1]);
+ int n = argc < 2 ? 200 : atoi(argv[1]);
int i;
setup_bodies();
diff --git a/test/c/nsieve.c b/test/c/nsieve.c
index 819d47f1..49fe385f 100644
--- a/test/c/nsieve.c
+++ b/test/c/nsieve.c
@@ -32,7 +32,7 @@ int main(int argc, char * argv[]) {
int m = argc < 2 ? 9 : atoi(argv[1]);
int i, j;
for (i = 0; i < 3; i++) {
- int n = 10000 << (m-i);
+ int n = 200 << (m-i);
unsigned count;
for (j = 0; j < NITER; j++) { count = nsieve(n); }
printf("Primes up to %8d %8u\n", n, count);
diff --git a/test/c/nsievebits.c b/test/c/nsievebits.c
index 743a5ffd..3a2e8b8b 100644
--- a/test/c/nsievebits.c
+++ b/test/c/nsievebits.c
@@ -48,7 +48,7 @@ main(int ac, char **av)
{
unsigned int n;
- n = ac < 2 ? 9 : atoi(av[1]);
+ n = ac < 2 ? 3 : atoi(av[1]);
test(n);
if (n >= 1)
test(n - 1);
diff --git a/test/c/perlin.c b/test/c/perlin.c
index e7bbd22d..b853aeed 100644
--- a/test/c/perlin.c
+++ b/test/c/perlin.c
@@ -63,13 +63,16 @@ static void init(void) {
p[256+i] = p[i] = permutation[i];
}
+#define INCREMENT 0.5
+#define MIN -5.0
+#define MAX 5.0
int main(int argc, char ** argv) {
init();
double x, y, z, sum = 0.0;
- for (x = -5.0; x < 5.0; x += 0.1)
- for (y = -5.0; y < 5.0; y += 0.1)
- for (z = -5.0; z < 5.0; z += 0.1)
+ for (x = MIN; x < MAX; x += INCREMENT)
+ for (y = MIN; y < MAX; y += INCREMENT)
+ for (z = MIN; z < MAX; z += INCREMENT)
sum += noise(x, y, z);
printf("%.4e\n", sum);
diff --git a/test/c/qsort.c b/test/c/qsort.c
index a9d5757a..a157f283 100644
--- a/test/c/qsort.c
+++ b/test/c/qsort.c
@@ -34,7 +34,7 @@ int main(int argc, char ** argv)
int n, i, j;
int * a, * b;
- if (argc >= 2) n = atoi(argv[1]); else n = 10000;
+ if (argc >= 2) n = atoi(argv[1]); else n = 3000;
a = malloc(n * sizeof(int));
b = malloc(n * sizeof(int));
for (j = 0; j < NITER; j++) {
diff --git a/test/c/spectral.c b/test/c/spectral.c
index f7dc90ee..7e56bf7f 100644
--- a/test/c/spectral.c
+++ b/test/c/spectral.c
@@ -43,7 +43,7 @@ void eval_AtA_times_u(int N, const double u[], double AtAu[])
int main(int argc, char *argv[])
{
int i;
- int N = ((argc == 2) ? atoi(argv[1]) : 1000);
+ int N = ((argc == 2) ? atoi(argv[1]) : 15);
double * u, * v, vBv, vv;
u = malloc(N * sizeof(double));
v = malloc(N * sizeof(double));
diff --git a/test/c/vmach.c b/test/c/vmach.c
index 815cb710..4e6848d2 100644
--- a/test/c/vmach.c
+++ b/test/c/vmach.c
@@ -159,8 +159,10 @@ long wordcode_interp(unsigned int* code)
#define I(a,b,c,d) ((a) + ((b) << 8) + ((c) << 16) + ((d) << 24))
+#define FIBSIZE 15
+
unsigned int wordcode_fib[] = {
-/* 0 */ I(WCONST, 30, 0, 0),
+/* 0 */ I(WCONST, FIBSIZE, 0, 0),
/* 1 */ I(WCALL1_pop1, 0, 3-1-1, 0),
/* 2 */ I(WSTOP, 0, 1, 0),
/* 3 */ I(WCONST, 2, 0, 0),
@@ -175,10 +177,15 @@ unsigned int wordcode_fib[] = {
/* 12 */ I(WCONST, 1, 0, 0),
/* 13 */ I(WRETURN, 0, 2, 0)
};
+
+#define TAKSIZE1 6
+#define TAKSIZE2 9
+#define TAKSIZE3 12
+
unsigned int wordcode_tak[] = {
-/* 0 */ I(WCONST, 6, 0, 0),
-/* 1 */ I(WCONST, 12, 0, 0),
-/* 2 */ I(WCONST, 18, 0, 0),
+/* 0 */ I(WCONST, TAKSIZE1, 0, 0),
+/* 1 */ I(WCONST, TAKSIZE2, 0, 0),
+/* 2 */ I(WCONST, TAKSIZE3, 0, 0),
/* 3 */ I(WCALL3, 3, 6-3-2, 0),
/* 4 */ I(0, 1, 2, 0),
/* 5 */ I(WSTOP, 0, 1, 0),
@@ -203,8 +210,8 @@ unsigned int wordcode_tak[] = {
int main(int argc, char ** argv)
{
- printf("fib(30) = %ld\n", wordcode_interp(wordcode_fib));
- printf("tak(18, 12, 6) = %ld\n", wordcode_interp(wordcode_tak));
+ printf("fib(%d) = %ld\n", FIBSIZE, wordcode_interp(wordcode_fib));
+ printf("tak(%d, %d, %d) = %ld\n", TAKSIZE3, TAKSIZE2, TAKSIZE1, wordcode_interp(wordcode_tak));
return 0;
}