From a4c242f24d02bc69853b21071bc34beff8f31d3b Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Sun, 19 Sep 2021 09:59:03 +0200 Subject: creduce scripts --- test/monniaux/csmith/reduce/reduce.sh | 15 +++++++++++++++ test/monniaux/csmith/reduce/reduce_wrt_host.sh | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 test/monniaux/csmith/reduce/reduce.sh create mode 100755 test/monniaux/csmith/reduce/reduce_wrt_host.sh (limited to 'test') 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..6e01f3a0 --- /dev/null +++ b/test/monniaux/csmith/reduce/reduce_wrt_host.sh @@ -0,0 +1,25 @@ +#!/bin/bash +INCLUDE=-I$COMPCERT/test/monniaux/csmith/csmith/include/csmith-2.3.0 +if gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.host && valgrind --exit-on-first-error=yes --error-exitcode=120 --log-file=valgrind.out ./source.gcc.host > source.gcc.host.out ; +then + if gcc $INCLUDE -Werror=uninitialized -Werror=implicit -fsanitize=undefined -fsanitize=address source.c -o source.gcc+san.host && ./source.gcc+san.host > source.gcc+san.host.out ; + then + if kvx-cos-gcc $INCLUDE -Werror=uninitialized -Werror=implicit source.c -o source.gcc.target && kvx-cluster -- source.gcc.target >& source.gcc.target.out && cmp source.gcc.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 + kvx-cluster -- source.ccomp.target >& source.ccomp.target.out + cmp source.ccomp.target.out source.gcc.target.out + else + exit 2 + fi + else + exit 1 + fi + else + exit 4 + fi +else + exit 5 +fi + -- cgit