summaryrefslogtreecommitdiff
path: root/test/ocaml/loop/loop.sail
diff options
context:
space:
mode:
authorBrian Campbell2017-10-18 15:07:24 +0100
committerBrian Campbell2017-10-18 15:07:24 +0100
commitbd9cabab3e20b92a705f37f0a1974033a869bde0 (patch)
treec73e3e47b4ce0578c9b79ca3ebd3ad74db93ffa4 /test/ocaml/loop/loop.sail
parent79043c19238559a7daea7b495e604ef00a6b2a8c (diff)
parent4043f496ff8dae7fa2bc2b4da4e02d2d9942e66d (diff)
Merge branch 'experiments' of Peter_Sewell/sail into mono-experiments
(and fix up monomorphisation)
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))
+ }
+}