From aad9ce3bda23efbab03595868bda7fc6dc3e03bf Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Fri, 2 Mar 2018 14:24:00 +0000 Subject: Fix off-by-one error in OCaml for loop compilation Fix for loop in interactive interpreter Fixes #8 --- test/ocaml/for_bounds/expect | 4 ++++ test/ocaml/for_bounds/for_bounds.sail | 7 +++++++ test/ocaml/for_bounds/test.isail | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 test/ocaml/for_bounds/expect create mode 100644 test/ocaml/for_bounds/for_bounds.sail create mode 100644 test/ocaml/for_bounds/test.isail (limited to 'test') diff --git a/test/ocaml/for_bounds/expect b/test/ocaml/for_bounds/expect new file mode 100644 index 00000000..6c06f0e0 --- /dev/null +++ b/test/ocaml/for_bounds/expect @@ -0,0 +1,4 @@ +i=0 +i=1 +i=2 +i=3 diff --git a/test/ocaml/for_bounds/for_bounds.sail b/test/ocaml/for_bounds/for_bounds.sail new file mode 100644 index 00000000..a7388a85 --- /dev/null +++ b/test/ocaml/for_bounds/for_bounds.sail @@ -0,0 +1,7 @@ + +val main : unit -> unit +function main () = { + foreach(i from 0 to 3) { + print_int("i=", i); + } +} diff --git a/test/ocaml/for_bounds/test.isail b/test/ocaml/for_bounds/test.isail new file mode 100644 index 00000000..6a9595e3 --- /dev/null +++ b/test/ocaml/for_bounds/test.isail @@ -0,0 +1,4 @@ +:output result +main() +:run +:quit \ No newline at end of file -- cgit v1.2.3