diff options
Diffstat (limited to 'test/typecheck')
| -rw-r--r-- | test/typecheck/pass/reg_list.sail | 7 | ||||
| -rw-r--r-- | test/typecheck/pass/reg_option.sail | 16 |
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; +} + |
