3 # Mes --- Maxwell Equations of Software
4 # Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6 # This file is part of Mes.
8 # Mes is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
13 # Mes is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Mes. If not, see <http://www.gnu.org/licenses/>.
21 if [ -n "$BUILD_DEBUG" ]; then
25 export BLOOD_ELF GUILE HEX2 M1 MES MESCC
26 export M1FLAGS HEX2FLAGS PREPROCESS
27 export MES_ARENA MES_PREFIX MES_SEED
29 export LIBC CC32LIBS MESCCLIBS
32 MESCC=${MESCC-scripts/mescc}
34 MES_PREFIX=${MES_PREFIX-.}
38 BLOOD_ELF=${BLOOD_ELF-blood-elf}
39 MES_SEED=${MES_SEED-../mes-seed}
40 MESCC=${MESCC-$(command -v mescc)}
41 [ -z "$MESCC" ] && MESCC=scripts/mescc
42 MES=${MES-$(command -v mes)}
43 [ -z "$MES" ] && MES=src/mes
45 if ! command -v $GUILE > /dev/null; then
85 47-function-expression
102 72-typedef-struct-def
106 76-pointer-arithmetic
114 7e-struct-array-access
115 7f-struct-pointer-arithmetic
116 7g-struct-byte-word-field
121 7l-struct-any-size-array
122 7m-struct-char-array-assign
123 7n-struct-struct-array
132 83-heterogenoous-init
146 # 90: needs GNU, fails for mescc, passes for tcc
154 expect=$(echo $broken | wc -w)
159 if [ -z "${t/[012][0-9]-*/}" ]; then
161 MESCCLIBS="-l c-mini"
162 elif [ -z "${t/[78][0-9a-z]-*/}" ]; then
165 elif [ -z "${t/9[0-9]-*/}" ]; then
172 sh build-aux/test.sh "scaffold/tests/$t" &> scaffold/tests/"$t".log
205 19_pointer_arithmetic
207 20_pointer_comparison
213 26_character_constants
224 36_array_initialisers
226 38_multiple_array_index
233 44_scoped_declarations
237 49_bracket_evaluation
239 50_logical_second_arg
252 26_character_constants
261 49_bracket_evaluation
265 #22_floating_point ; float
266 #23_type_coercion ; float
267 #24_math_library ; float
269 #28_strings ; TODO: strncpy strchr strrchr memset memcpy memcmp
270 #30_hanoi ; fails with GCC
271 #34_array_assignment ; fails with GCC
272 #39_typedef ;unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (typename "MyFunStruct"))) (init-declr-list (init-declr (ptr-declr (pointer) (ident "MoreFunThanEver")))))
274 #40_stdio ; f* functions
275 #42_function_pointer ; f* functions
276 #49_bracket_evaluation ; float
281 expect=$(echo $broken | wc -w)
282 ARGS="arg1 arg2 arg3 arg4 arg5"
285 if [ ! -f scaffold/tinycc/"$t.c" ]; then
289 sh build-aux/test.sh "scaffold/tinycc/$t" &> scaffold/tinycc/"$t".log
300 [ $expect != 0 ] && echo "expect: $expect"
301 [ $fail != 0 ] && echo "failed: $fail"
302 [ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
305 if [ $fail != 0 -a $fail -gt $expect ]; then
306 echo FAILED: $fail/$total
308 elif [ $fail != 0 ]; then
309 echo PASS: $pass/$total