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 export MES=${MES-src/mes}
22 export MESCC=${MESCC-scripts/mescc}
23 export GUILE=${GUILE-guile}
24 export MES_PREFIX=${MES_PREFIX-.}
26 export HEX2=${HEX2-hex2}
28 export BLOOD_ELF=${BLOOD_ELF-blood-elf}
29 export MES_SEED=${MES_SEED-../mes-seed}
30 export MESCC=${MESCC-$(type -p mescc)}
31 [ -z "$MESCC" ] && MESCC=scripts/mescc
32 export MES=${MES-$(type -p mes)}
33 [ -z "$MES" ] && MES=src/mes
95 7e-struct-array-access
96 7f-struct-pointer-arithmetic
97 7g-struct-byte-word-field
102 7l-struct-any-size-array
103 7m-struct-char-array-assign
104 7n-struct-struct-array
110 if [ ! -x ./i686-unknown-linux-gnu-tcc ]; then
111 tests=$(echo "$tests" | grep -Ev "02-return-1|05-call-1|80-setjmp|81-qsort")
118 sh build-aux/test.sh "scaffold/tests/$t" &> scaffold/tests/"$t".log
150 19_pointer_arithmetic
152 20_pointer_comparison
177 44_scoped_declarations
184 50_logical_second_arg
191 #13_integer_literals ; fail
192 #22_floating_point ; float
193 #23_type_coercion ; float
194 #24_math_library ; float
196 #28_strings ; TODO: strncpy strchr strrchr memset memcpy memcmp
197 #30_hanoi ; fails with GCC
198 #32_led ; unsupported: (decl (decl-spec-list (stor-spec (static)) (type-spec (fixed-type "int"))) (init-declr-list (init-declr (array-of (ident "d") (p-expr (fixed "32"))))))
199 #34_array_assignment ; fails with GCC
200 #36_array_initialisers ; unspported: (decl (decl-spec-list (type-spec (fixed-type "int"))) (init-declr-list (init-declr (array-of (ident "Array") (p-expr (fixed "10"))) (initzer (initzer-list (initzer (p-expr (fixed "12"))) (initzer (p-expr (fixed "34"))) (initzer (p-expr (fixed "56"))) (initzer (p-expr (fixed "78"))) (initzer (p-expr (fixed "90"))) (initzer (p-expr (fixed "123"))) (initzer (p-expr (fixed "456"))) (initzer (p-expr (fixed "789"))) (initzer (p-expr (fixed "8642"))) (initzer (p-expr (fixed "9753"))))))))
201 #37_sprintf ; integer formatting unsupported
202 #38_multiple_array_index ; unspported: (decl (decl-spec-list (type-spec (fixed-type "int"))) (init-declr-list (init-declr (array-of (array-of (ident "a") (p-expr (fixed "4"))) (p-expr (fixed "4"))))))
203 #39_typedef ;unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (typename "MyFunStruct"))) (init-declr-list (init-declr (ptr-declr (pointer) (ident "MoreFunThanEver")))))
205 #40_stdio ; f* functions
206 #42_function_pointer ; f* functions
207 #46_grep ; f* functions
208 #49_bracket_evaluation ; float
209 #51_static ; unsupported: (decl (decl-spec-list (stor-spec (static)) (type-spec (fixed-type "int"))) (init-declr-list (init-declr (ident "fred") (initzer (p-expr (fixed "1234"))))))
210 #52_unnamed_enum ; unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (enum-def (enum-def-list (enum-defn (ident "e")) (enum-defn (ident "f")) (enum-defn (ident "g")))))) (init-declr-list (init-declr (ident "h"))))
211 #55_lshift_type ; unsigned
214 # FIXME: have no diff
217 if [ ! -f scaffold/tinycc/"$t.c" ]; then
221 sh build-aux/test.sh "scaffold/tinycc/$t" &> scaffold/tinycc/"$t".log
232 if [ $fail != 0 ]; then
233 echo FAILED: $fail/$total