aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/monniaux/csmith/reduce/reduce.sh15
-rwxr-xr-xtest/monniaux/csmith/reduce/reduce_wrt_host.sh28
2 files changed, 43 insertions, 0 deletions
diff --git a/test/monniaux/csmith/reduce/reduce.sh b/test/monniaux/csmith/reduce/reduce.sh
new file mode 100755
index 00000000..d8df11a5
--- /dev/null
+++ b/test/monniaux/csmith/reduce/reduce.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0
+if kvx-cos-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && kvx-cluster -- source.gcc.target >& source.gcc.log
+then
+ if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target
+ then
+ kvx-cluster -- source.ccomp.target >& source.ccomp.log
+ grep OPCODE source.ccomp.log
+ else
+ exit 2
+ fi
+else
+ exit 1
+fi
+
diff --git a/test/monniaux/csmith/reduce/reduce_wrt_host.sh b/test/monniaux/csmith/reduce/reduce_wrt_host.sh
new file mode 100755
index 00000000..5e86213e
--- /dev/null
+++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0
+if /usr/bin/clang $INCLUDE -O -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type source.c -o source.clang.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.clang.host > source.clang.host.out ;
+then
+ if gcc $INCLUDE -Werror=strict-prototypes -Werror=uninitialized -Werror=implicit -Werror=return-type -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ;
+ then
+ if cmp source.clang.host.out source.gcc+san.host.out && riscv64-linux-gnu-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -Werror=return-type -o source.gcc.target && qemu-riscv64 -L /usr/riscv64-linux-gnu source.gcc.target >& source.gcc.target.out && grep checksum source.gcc.target.out && diff source.clang.host.out source.gcc.target.out
+ then
+ if $COMPCERT/ccomp $INCLUDE -fall -fno-cse -fno-cse2 -fno-cse3 source.c -o source.ccomp.target
+ then
+ qemu-riscv64 -L /usr/riscv64-linux-gnu source.ccomp.target >& source.ccomp.target.out
+ if grep checksum source.ccomp.target.out && diff source.ccomp.target.out source.gcc.target.out
+ then exit 40
+ else exit 0
+ fi
+ else
+ exit 2
+ fi
+ else
+ exit 1
+ fi
+ else
+ exit 4
+ fi
+else
+ exit 5
+fi
+