aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa/lib
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-11-09 17:07:13 +0100
committerCyril SIX <cyril.six@kalray.eu>2018-11-09 17:07:13 +0100
commitf24d303df6cb125ca19b953bb364955cc6e8c246 (patch)
treee885cbb64c217ddec1b02a350679b3f2a29d6373 /test/mppa/lib
parent622a211d4ebd47feb4d2c7dfe590d10c6d6ae834 (diff)
downloadcompcert-kvx-f24d303df6cb125ca19b953bb364955cc6e8c246.tar.gz
compcert-kvx-f24d303df6cb125ca19b953bb364955cc6e8c246.zip
Fixed consistency between the different tests mmult, prng and sort
Diffstat (limited to 'test/mppa/lib')
-rw-r--r--test/mppa/lib/.gitignore2
-rw-r--r--test/mppa/lib/Makefile30
-rw-r--r--test/mppa/lib/prng.c39
-rw-r--r--test/mppa/lib/prng.h10
-rw-r--r--test/mppa/lib/types.h7
5 files changed, 0 insertions, 88 deletions
diff --git a/test/mppa/lib/.gitignore b/test/mppa/lib/.gitignore
deleted file mode 100644
index 1879eaee..00000000
--- a/test/mppa/lib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-prng-test-k1c
-prng-test-x86
diff --git a/test/mppa/lib/Makefile b/test/mppa/lib/Makefile
deleted file mode 100644
index 74e7ca8b..00000000
--- a/test/mppa/lib/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-prng-test-x86: prng.c
- gcc -D__UNIT_TEST_PRNG__ -O2 -std=c99 $< -o $@
-
-prng-test-k1c: prng.c
- k1-mbr-gcc -D__UNIT_TEST_PRNG__ -O2 -std=c99 $< -o $@
-
-.PHONY:
-test: test-x86 test-k1c
-
-.PHONY:
-test-x86: prng-test-x86
- @if ! ./$<; then\
- >&2 echo "ERROR: $< failed";\
- exit;\
- else\
- echo "x86: Test Succeeded";\
- fi
-
-.PHONY:
-test-k1c: prng-test-k1c
- @if ! k1-cluster -- ./$<; then\
- >&2 echo "ERROR: $< failed";\
- exit;\
- else\
- echo "k1c: Test Succeeded";\
- fi
-
-.PHONY:
-clean:
- rm -f prng-test-x86 prng-test-k1c
diff --git a/test/mppa/lib/prng.c b/test/mppa/lib/prng.c
deleted file mode 100644
index af3903d6..00000000
--- a/test/mppa/lib/prng.c
+++ /dev/null
@@ -1,39 +0,0 @@
-// https://en.wikipedia.org/wiki/Linear_congruential_generator -> MMIX Donald Knuth
-// modulo 2^64 = no need to do it explicitly
-
-#include "types.h"
-
-#define MULTIPLIER 6364136223846793005LL
-#define INCREMENT 1442695040888963407LL
-
-static uint64_t current;
-
-void srand(uint64_t seed){
- current = seed;
-}
-
-uint64_t randlong(void){
- return (current = MULTIPLIER * current + INCREMENT);
-}
-
-#ifdef __UNIT_TEST_PRNG__
-char bytewise_sum(uint64_t to_check){
- char sum = 0;
-
- for (int i = 0 ; i < 8 ; i++)
- sum += (to_check & (uint64_t)(0xFFULL << i*8)) >> i*8;
-
- return sum;
-}
-
-int main(void){
- srand(42);
-
- for (int i = 0 ; i < 1000 ; i++)
- randlong();
-
- uint64_t last = randlong();
-
- return !((unsigned char)bytewise_sum(last) == 155);
-}
-#endif // __UNIT_TEST_PRNG__
diff --git a/test/mppa/lib/prng.h b/test/mppa/lib/prng.h
deleted file mode 100644
index 6abdb45a..00000000
--- a/test/mppa/lib/prng.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PRNG_H__
-#define __PRNG_H__
-
-#include "types.h"
-
-void srand(uint64_t seed);
-
-uint64_t randlong(void);
-
-#endif // __PRNG_H__
diff --git a/test/mppa/lib/types.h b/test/mppa/lib/types.h
deleted file mode 100644
index 584023e3..00000000
--- a/test/mppa/lib/types.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __TYPES_H__
-#define __TYPES_H__
-
-#define uint64_t unsigned long long
-#define int64_t signed long long
-
-#endif // __TYPES_H__