summaryrefslogtreecommitdiff
path: root/tests/std
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-05-08 14:38:22 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-05-08 14:38:22 -0400
commit5dabbe87ed4e86fa0306fd9ef11e7a7fee2a6ddb (patch)
tree36faaf68a5550c408ac8fa3c38e05ab4d05a1f57 /tests/std
parentd8f78898f453e7474dc25fb5f60f6507c68b5f90 (diff)
got double include to REALLY work
Diffstat (limited to 'tests/std')
-rw-r--r--tests/std/io.toc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/std/io.toc b/tests/std/io.toc
index 9fa7e08..2b9e999 100644
--- a/tests/std/io.toc
+++ b/tests/std/io.toc
@@ -51,3 +51,12 @@ puti ::= fn(x: int) {
toc_putchar('\n');
}
+printf ::= #foreign("printf", base.libc) fn (#C &"const char", #C ..) #C int;
+writef ::= fn(x: float) {
+ fmt := "%f\0";
+ printf(&fmt[0], x);
+}
+putf ::= fn(x: float) {
+ writef(x);
+ toc_putchar('\n');
+}