aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/csmith/reduce/reduce_wrt_host.sh
blob: 23e4208e5e0e52e4f30fd2f230d443c31e08dccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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
		if cmp 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