summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-29 01:33:27 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-29 01:33:27 -0700
commit6a4040c99ee0127808d77ad2dc38220f1a8a1c46 (patch)
tree13bcf7821021b988dd0e7ad546dd92ce8253017e /test
parent501c03fca3a77243ae2e7415a199b08e806c96b2 (diff)
downloadmc-6a4040c99ee0127808d77ad2dc38220f1a8a1c46.tar.gz
Implement casting functions to pointers.
Useful for interfacing with C ABIs.
Diffstat (limited to 'test')
-rw-r--r--test/fncast.myr16
-rw-r--r--test/tests1
2 files changed, 17 insertions, 0 deletions
diff --git a/test/fncast.myr b/test/fncast.myr
new file mode 100644
index 0000000..08b8d1e
--- /dev/null
+++ b/test/fncast.myr
@@ -0,0 +1,16 @@
+use std
+
+const main = {
+ var fn, envfn
+ var ptr
+
+ fn = {
+ }
+ envfn = {
+ ptr = ptr
+ }
+ ptr = fn castto(byte#)
+ ptr = envfn castto(byte#)
+ std.put("ok\n", ptr)
+}
+
diff --git a/test/tests b/test/tests
index e24a6c5..9fb9246 100644
--- a/test/tests
+++ b/test/tests
@@ -59,6 +59,7 @@ B callbig E 42
B nestfn E 42
B foldidx P 123,456
B closure P 111555333666
+B fncast P ok
B loop P 0123401236789
B subrangefor P 12
B patiter P 23512