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
144 # 90: needs GNU, fails for mescc, passes for tcc
152 expect=$(echo $broken | wc -w)
157 if [ -z "${t/[012][0-9]-*/}" ]; then
159 MESCCLIBS="-l c-mini"
160 elif [ -z "${t/[78][0-9a-z]-*/}" ]; then
163 elif [ -z "${t/9[0-9]-*/}" ]; then
170 sh build-aux/test.sh "scaffold/tests/$t" &> scaffold/tests/"$t".log
203 19_pointer_arithmetic
205 20_pointer_comparison
211 26_character_constants
222 36_array_initialisers
224 38_multiple_array_index
231 44_scoped_declarations
235 49_bracket_evaluation
237 50_logical_second_arg
250 26_character_constants
259 49_bracket_evaluation
263 #22_floating_point ; float
264 #23_type_coercion ; float
265 #24_math_library ; float
267 #28_strings ; TODO: strncpy strchr strrchr memset memcpy memcmp
268 #30_hanoi ; fails with GCC
269 #34_array_assignment ; fails with GCC
270 #39_typedef ;unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (typename "MyFunStruct"))) (init-declr-list (init-declr (ptr-declr (pointer) (ident "MoreFunThanEver")))))
272 #40_stdio ; f* functions
273 #42_function_pointer ; f* functions
274 #49_bracket_evaluation ; float
279 expect=$(echo $broken | wc -w)
280 ARGS="arg1 arg2 arg3 arg4 arg5"
283 if [ ! -f scaffold/tinycc/"$t.c" ]; then
287 sh build-aux/test.sh "scaffold/tinycc/$t" &> scaffold/tinycc/"$t".log
298 [ $expect != 0 ] && echo "expect: $expect"
299 [ $fail != 0 ] && echo "failed: $fail"
300 [ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
303 if [ $fail != 0 -a $fail -gt $expect ]; then
304 echo FAILED: $fail/$total
306 elif [ $fail != 0 ]; then
307 echo PASS: $pass/$total