summaryrefslogtreecommitdiff
path: root/test/mono/varmatch.sail
blob: c3c2994da015472a9edd7b0eee09fe86e5dd0ea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
val operator & = "and_bool" : (bool, bool) -> bool
val operator == = {ocaml: "(fun (x, y) -> x = y)", lem: "eq"} : forall ('a : Type). ('a, 'a) -> bool

/* Check that when we case split on a variable that the constant propagation
   handles the default case correctly. */

enum AnEnum = One | Two | Three

val foo : AnEnum -> AnEnum

function foo(x) = {
  match (x) {
  One => Two,
  y => y
  }
}

val run : unit -> unit effect {escape}

function run () = {
  assert(foo(One) == Two);
  assert(foo(Two) == Two);
  assert(foo(Three) == Three);
}