aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/picosat-965/onefile/testcmp.sh
blob: 2228c6751bffaadb7452bef925932aef2ce845e7 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
DEFINES="-DNALARM -DNZIP -DNGETRUSAGE -DNDEBUG"
COMPCERT=/local/monniaux/Kalray/mppa-RTLpathSE-verif-hash-junk
DATA=$COMPCERT/test/monniaux/picosat-965/tiny.dat
CCOMP="$COMPCERT/ccomp -fbitfields -fduplicate 2 -fall-loads-nontrap $DEFINES"
GCC="kvx-cos-gcc -O -Wimplicit -Wuninitialized -Wmaybe-uninitialized -Werror $DEFINES"
HOSTCC0="gcc -Wimplicit -Wuninitialized -Wmaybe-uninitialized -Werror $DEFINES"
HOSTCC1="gcc -O -Wimplicit -Wuninitialized -Wmaybe-uninitialized -Werror $DEFINES"
HOSTCC2="gcc -O -Wimplicit -Wuninitialized -Wmaybe-uninitialized -Werror -fsanitize=undefined -fsanitize=address $DEFINES"
HOSTCC3="gcc -O3 -Wimplicit -Wuninitialized -Wmaybe-uninitialized -Werror $DEFINES"
HOSTCC4="clang -Wimplicit -Wuninitialized -Werror $DEFINES"
HOSTCC5="clang -Wimplicit -Wuninitialized -Werror -fsanitize=undefined -fsanitize=address $DEFINES"
CFILES="picosat.c"
SIMU="kvx-cluster --timeout=100000 -- "

if ! $HOSTCC0 $CFILES -o picosat.cc0.host ;
then exit 30 ;
fi

if ! $HOSTCC1 $CFILES -o picosat.cc1.host ;
then exit 31 ;
fi

if ! $HOSTCC2 $CFILES -o picosat.cc2.host ;
then exit 32 ;
fi

if ! $HOSTCC3 $CFILES -o picosat.cc3.host ;
then exit 33 ;
fi

if ! $HOSTCC4 $CFILES -o picosat.cc4.host ;
then exit 34 ;
fi

if ! $HOSTCC5 $CFILES -o picosat.cc5.host ;
then exit 35 ;
fi

timeout 1 ./picosat.cc0.host $DATA 2>&1 > picosat.cc0.out
if [ $? -ge 100 ];
then exit 40 ;
fi

timeout 1 ./picosat.cc1.host $DATA 2>&1 > picosat.cc1.out
if [ $? -ge 100 ];
then exit 41 ;
fi

timeout 1 valgrind --log-file=picosat.cc0.valgrind.log ./picosat.cc0.host $DATA 2>&1 > picosat.cc0.valgrind.out
if [ $? -ge 100 ];
then exit 50 ;
fi

timeout 1 valgrind --log-file=picosat.cc1.valgrind.log ./picosat.cc1.host $DATA 2>&1 > picosat.cc1.valgrind.out
if [ $? -ge 100 ];
then exit 51 ;
fi

timeout 1 ./picosat.cc2.host $DATA 2>&1 > picosat.cc2.out
if [ $? -ge 100 ];
then exit 42 ;
fi

timeout 1 ./picosat.cc3.host $DATA 2>&1 > picosat.cc3.out
if [ $? -ge 100 ];
then exit 43 ;
fi

timeout 1 ./picosat.cc4.host $DATA 2>&1 > picosat.cc4.out
if [ $? -ge 100 ];
then exit 44 ;
fi

timeout 1 ./picosat.cc5.host $DATA 2>&1 > picosat.cc5.out
if [ $? -ge 100 ];
then exit 45 ;
fi

if ! cmp picosat.cc0.out picosat.cc1.out ;
then exit 60 ;
fi

if ! cmp picosat.cc0.out picosat.cc0.valgrind.out ;
then exit 70 ;
fi

if ! cmp picosat.cc1.out picosat.cc1.valgrind.out ;
then exit 61 ;
fi

if ! cmp picosat.cc1.out picosat.cc2.out ;
then exit 62 ;
fi

if ! cmp picosat.cc1.out picosat.cc3.out ;
then exit 63 ;
fi

if ! $GCC $CFILES -o picosat.gcc.target ;
then exit 1 ;
fi

if ! $CCOMP $CFILES -o picosat.ccomp.target ;
then exit 2 ;
fi

if ! $CCOMP -fprepass -fprepass= list $CFILES -o picosat.prepass.target ;
then exit 3 ;
fi

$SIMU ./picosat.gcc.target $DATA 2>&1 > picosat.gcc.out
if [ $? -ge 100 ];
then exit 4 ;
fi

if ! cmp picosat.gcc.out picosat.cc1.out ;
then exit 13 ;
fi

if grep timeout picosat.gcc.out ;
then exit 8 ;
fi

$SIMU ./picosat.ccomp.target $DATA 2>&1 > picosat.ccomp.out
if [ $? -ge 100 ];
then exit 5 ;
fi

if grep timeout picosat.ccomp.out ;
then exit 9 ;
fi

if ! cmp picosat.gcc.out picosat.ccomp.out ;
then exit 6 ;
fi

$SIMU ./picosat.prepass.target $DATA 2>&1 > picosat.prepass.out
if [ $? -ge 100 ];
then exit 0 ;
fi

if cmp picosat.gcc.out picosat.prepass.out ;
then exit 7 ;
fi

exit 0