diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-25 20:35:46 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-25 20:35:46 -0500 |
commit | 19eafbc01a492e8f1df25cef52678ed8f76d3e63 (patch) | |
tree | e818784215d9f7873e9495f003dd4cdaa09d5b63 /tests | |
parent | b1c2b4bcabfd3ff01921e2601d41a33b40ec1f3b (diff) |
fixed bugs with new arg order system
also now struct parameters are "officially" part of the language
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arr/arr.toc | 11 | ||||
-rw-r--r-- | tests/arr2/arr2.toc | 10 | ||||
-rw-r--r-- | tests/bf/bf.toc | 5 | ||||
-rw-r--r-- | tests/params/params.toc | 5 | ||||
-rwxr-xr-x | tests/test.sh | 2 |
5 files changed, 27 insertions, 6 deletions
diff --git a/tests/arr/arr.toc b/tests/arr/arr.toc index f7c6707..a682283 100644 --- a/tests/arr/arr.toc +++ b/tests/arr/arr.toc @@ -1,9 +1,16 @@ puti ::= fn(x: int) { - #C("extern int printf(const char *fmt, ...)"); +//tcc's giving me "incompatible types for redefinition of 'printf'" for some reason (even though the declarations have the exact same type) + #C("#ifndef __TINYC__ +extern int printf(const char *fmt, ...); +#endif +"); #C("printf(\"%ld\\n\", (long)x)"); }; putf ::= fn(x: float) { - #C("extern int printf(const char *fmt, ...)"); + #C("#ifndef __TINYC__ +extern int printf(const char *fmt, ...); +#endif +"); #C("printf(\"%f\\n\", (double)x)"); }; diff --git a/tests/arr2/arr2.toc b/tests/arr2/arr2.toc index e28d355..e016cf2 100644 --- a/tests/arr2/arr2.toc +++ b/tests/arr2/arr2.toc @@ -1,10 +1,16 @@ puti ::= fn(x: int) { - #C("extern int printf(const char *fmt, ...)"); +#C("#ifndef __TINYC__ +extern int printf(const char *fmt, ...); +#endif +"); #C("printf(\"%ld\\n\", (long)x); "); }; putf ::= fn(x: float) { - #C("extern int printf(const char *fmt, ...)"); +#C("#ifndef __TINYC__ +extern int printf(const char *fmt, ...); +#endif +"); #C("printf(\"%f\\n\", (double)x); "); }; diff --git a/tests/bf/bf.toc b/tests/bf/bf.toc index c2f9970..a3f731a 100644 --- a/tests/bf/bf.toc +++ b/tests/bf/bf.toc @@ -32,7 +32,10 @@ getstdin ::= fn() []char { }; puti ::= fn(x: int) { - #C("extern int printf(const char *fmt, ...)"); + #C("#ifndef __TINYC__ +extern int printf(const char *fmt, ...); +#endif +"); #C("printf(\"%ld\\n\", x)"); }; diff --git a/tests/params/params.toc b/tests/params/params.toc index 3d8800d..1946739 100644 --- a/tests/params/params.toc +++ b/tests/params/params.toc @@ -7,7 +7,10 @@ do_foo ::= fn (x := 3) y := x { }; puti ::= fn(x: int) { - #C("extern int printf(const char *fmt, ...)"); + #C("#ifndef __TINYC__ +extern int printf(const char *fmt, ...); +#endif +"); #C("printf(\"%ld\\n\", x)"); }; diff --git a/tests/test.sh b/tests/test.sh index 9224ee3..4852218 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -10,6 +10,8 @@ compile() { EXTRA_FLAGS="-Wno-builtin-declaration-mismatch" elif [ "$CC" = "clang -O3 -s" ]; then EXTRA_FLAGS="-Wno-builtin-requires-header" + elif [ "$CC" = "tcc" ]; then + EXTRA_FLAGS="-w" fi $CC $CFLAGS $EXTRA_FLAGS -o $DIR/$1/$1.bin $DIR/$1/$1.c || exit 1 } |