summaryrefslogtreecommitdiff
path: root/test/ocaml/loop/loop.sail
diff options
context:
space:
mode:
Diffstat (limited to 'test/ocaml/loop/loop.sail')
-rw-r--r--test/ocaml/loop/loop.sail18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ocaml/loop/loop.sail b/test/ocaml/loop/loop.sail
new file mode 100644
index 00000000..5ab0e817
--- /dev/null
+++ b/test/ocaml/loop/loop.sail
@@ -0,0 +1,18 @@
+
+val extern int -> string effect pure string_of_int = "string_of_big_int"
+
+val extern (int, int) -> int effect pure add = "add"
+val extern (int, int) -> bool effect pure lt = "lt_int"
+
+overload (deinfix +) [add]
+overload (deinfix <) [lt]
+
+val unit -> unit effect pure main
+
+function main () = {
+ (int) x := 0;
+ while x < 100 do {
+ x := x + 1;
+ print(string_of_int(x))
+ }
+}