From 1dcd59b9cb80f879dff96061ba7ee8111dcff0f9 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Mon, 27 Nov 2017 18:51:37 +0000 Subject: Added test for short-circuiting of boolean operations --- test/ocaml/short_circuit/expect | 1 + test/ocaml/short_circuit/sc.sail | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/ocaml/short_circuit/expect create mode 100644 test/ocaml/short_circuit/sc.sail (limited to 'test') diff --git a/test/ocaml/short_circuit/expect b/test/ocaml/short_circuit/expect new file mode 100644 index 00000000..9766475a --- /dev/null +++ b/test/ocaml/short_circuit/expect @@ -0,0 +1 @@ +ok diff --git a/test/ocaml/short_circuit/sc.sail b/test/ocaml/short_circuit/sc.sail new file mode 100644 index 00000000..a0f4941d --- /dev/null +++ b/test/ocaml/short_circuit/sc.sail @@ -0,0 +1,15 @@ + +val fail : unit -> bool effect {escape} + +function fail () = { + assert(false); + true +} + +val main : unit -> unit effect {escape} + +function main () = { + assert(~(false & fail())); + assert(true | fail()); + print("ok") +} \ No newline at end of file -- cgit v1.2.3