summaryrefslogtreecommitdiff
path: root/test/typecheck
diff options
context:
space:
mode:
authorJon French2018-05-15 17:50:05 +0100
committerJon French2018-05-15 17:50:05 +0100
commite2d8fe4d847b6e8f71eecd7aa6d15799bd2a2e11 (patch)
treeaf5ca7ac35244a706f9631ab8f1a4dada172f27d /test/typecheck
parented3bb9702bd1f76041a3798f453714b0636a1b6b (diff)
parent77b393e4f53d14955d301cbd16e22d2e7b026ede (diff)
Merge branch 'sail2' into mappings
Diffstat (limited to 'test/typecheck')
-rw-r--r--test/typecheck/pass/reg_list.sail7
-rw-r--r--test/typecheck/pass/reg_option.sail16
2 files changed, 23 insertions, 0 deletions
diff --git a/test/typecheck/pass/reg_list.sail b/test/typecheck/pass/reg_list.sail
new file mode 100644
index 00000000..bf776942
--- /dev/null
+++ b/test/typecheck/pass/reg_list.sail
@@ -0,0 +1,7 @@
+register X : list(bool)
+
+val init_X : unit -> unit effect {wreg}
+function init_X () = {
+ X = [||];
+}
+
diff --git a/test/typecheck/pass/reg_option.sail b/test/typecheck/pass/reg_option.sail
new file mode 100644
index 00000000..55317d1f
--- /dev/null
+++ b/test/typecheck/pass/reg_option.sail
@@ -0,0 +1,16 @@
+$include <arith.sail>
+$include <flow.sail>
+$include <option.sail>
+
+register X : option(int)
+
+val inc_X : unit -> int effect {rreg, wreg}
+function inc_X () = {
+ let x : int = match X {
+ Some(x) => x + 1,
+ None() => 0
+ };
+ X = Some(x);
+ return x;
+}
+