summaryrefslogtreecommitdiff
path: root/test/mono/vector.sail
diff options
context:
space:
mode:
Diffstat (limited to 'test/mono/vector.sail')
-rw-r--r--test/mono/vector.sail21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/mono/vector.sail b/test/mono/vector.sail
new file mode 100644
index 00000000..03f36da5
--- /dev/null
+++ b/test/mono/vector.sail
@@ -0,0 +1,21 @@
+(* Check case splitting on a vector *)
+
+default Order dec
+
+val bit[32] -> nat effect pure test
+
+function nat test((bit[2]) sel : (bit[30]) _) = {
+ switch (sel) {
+ case 0b00 -> 5
+ case 0b10 -> 1
+ case _ -> 0
+ }
+}
+
+val unit -> bool effect pure run
+
+function run () = {
+ test(0x0f353533) == 5 &
+ test(0x84534656) == 1 &
+ test(0xf3463903) == 0
+}