From 209f9cc599aa0692a8558e97626d542aff24715b Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 14 May 2018 21:18:08 +0200 Subject: [PATCH] mescc: Tinycc support: Update some tests. --- build-aux/check-mescc.sh | 6 +----- scaffold/tests/00-exit-0.c | 4 ++++ scaffold/tests/47-function-expression.c | 4 ++++ scaffold/tests/49-global-static.c | 7 ++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh index f2f7a160..4a607ec6 100755 --- a/build-aux/check-mescc.sh +++ b/build-aux/check-mescc.sh @@ -242,9 +242,7 @@ broken="$broken #27_sizeof ; float #28_strings ; TODO: strncpy strchr strrchr memset memcpy memcmp #30_hanoi ; fails with GCC -#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")))))) #34_array_assignment ; fails with GCC -#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")))))))) #37_sprintf ; integer formatting unsupported #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")))))) #39_typedef ;unsupported: (decl (decl-spec-list (stor-spec (typedef)) (type-spec (typename "MyFunStruct"))) (init-declr-list (init-declr (ptr-declr (pointer) (ident "MoreFunThanEver"))))) @@ -253,9 +251,7 @@ broken="$broken #42_function_pointer ; f* functions #46_grep ; f* functions #49_bracket_evaluation ; float -#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")))))) -#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")))) -#55_lshift_type ; unsigned + expect=$(echo $broken | wc -w) diff --git a/scaffold/tests/00-exit-0.c b/scaffold/tests/00-exit-0.c index 210fc11e..77038b6f 100644 --- a/scaffold/tests/00-exit-0.c +++ b/scaffold/tests/00-exit-0.c @@ -28,6 +28,10 @@ main () #else // !__MESC__ asm ("mov $0,%ebx"); asm ("mov $1,%eax"); +#if !__TINYC__ asm ("int $0x80"); +#else + asm ("int $128"); +#endif #endif } diff --git a/scaffold/tests/47-function-expression.c b/scaffold/tests/47-function-expression.c index 89d1bd05..80acb16e 100644 --- a/scaffold/tests/47-function-expression.c +++ b/scaffold/tests/47-function-expression.c @@ -20,6 +20,10 @@ int g_time = 1; +#if __TINYC__ +#define time time_ +#endif + int* time () { diff --git a/scaffold/tests/49-global-static.c b/scaffold/tests/49-global-static.c index 5b453f1b..4a3e4e4c 100644 --- a/scaffold/tests/49-global-static.c +++ b/scaffold/tests/49-global-static.c @@ -18,6 +18,10 @@ * along with Mes. If not, see . */ +#if __TINYC__ +#define unsigned +#endif + static int sint; static int sint2, sint3; typedef unsigned int size; @@ -34,5 +38,6 @@ int main () { void (*foo)() = &test; - return test (0); + test (0); + return 0; }