summaryrefslogtreecommitdiff
path: root/test/mono/vector.sail
blob: 03f36da506a12600c73f0766420edb32c7773d26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
}