diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arr/arr.toc | 8 | ||||
-rw-r--r-- | tests/arr2/arr2.toc | 2 | ||||
-rw-r--r-- | tests/bf/bf.toc | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/arr/arr.toc b/tests/arr/arr.toc index 4cabd9e..d18e8ea 100644 --- a/tests/arr/arr.toc +++ b/tests/arr/arr.toc @@ -1,10 +1,10 @@ puti ::= fn(x: int) { - #C("printf(\"%ld\\n\", (long)x); -"); + #C("extern int printf(const char *fmt, ...)"); + #C("printf(\"%ld\\n\", (long)x)"); }; putf ::= fn(x: float) { - #C("printf(\"%f\\n\", (double)x); -"); + #C("extern int printf(const char *fmt, ...)"); + #C("printf(\"%f\\n\", (double)x)"); }; // it would be nice if Arr.data.len == Arr.len (: but this will require some C code... diff --git a/tests/arr2/arr2.toc b/tests/arr2/arr2.toc index ea9ea79..7056416 100644 --- a/tests/arr2/arr2.toc +++ b/tests/arr2/arr2.toc @@ -1,8 +1,10 @@ puti ::= fn(x: int) { + #C("extern int printf(const char *fmt, ...)"); #C("printf(\"%ld\\n\", (long)x); "); }; putf ::= fn(x: float) { + #C("extern int printf(const char *fmt, ...)"); #C("printf(\"%f\\n\", (double)x); "); }; diff --git a/tests/bf/bf.toc b/tests/bf/bf.toc index b624101..c2f9970 100644 --- a/tests/bf/bf.toc +++ b/tests/bf/bf.toc @@ -32,10 +32,12 @@ getstdin ::= fn() []char { }; puti ::= fn(x: int) { + #C("extern int printf(const char *fmt, ...)"); #C("printf(\"%ld\\n\", x)"); }; main ::= fn() { + #C("extern int putchar(int c)"); code := getstdin(); tape_sz := 3; tape := new(int, tape_sz); |