summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-21 13:20:25 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-21 13:21:02 -0500
commit10dbaa3391e8ad4e076a6fcd6f9790d7f625552a (patch)
tree1628328b590799e84daf0593f8eae776038338ac /test.toc
parent8406747331eef16a525f0dbf4d26445d243e19d1 (diff)
only load libraries once
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc6
1 files changed, 6 insertions, 0 deletions
diff --git a/test.toc b/test.toc
index 3cd0b33..4bcb48e 100644
--- a/test.toc
+++ b/test.toc
@@ -24,6 +24,12 @@ foo ::= fn() i32 {
puts("Hey")
};
+malloc :: fn(u64) &u8 = #foreign "malloc", "libc.so.6";
+
+sqrt :: fn(f64) f64 = #foreign "sqrt", "libm.so";
+
main ::= fn() {
x ::= foo();
+ y ::= malloc(10);
+ sq2 ::= sqrt(2);
}; \ No newline at end of file