summaryrefslogtreecommitdiff
path: root/test/c/short_circuit.sail
blob: 8289efa667b370a5beafcece5d312b363bdfd29c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$include <exception_basic.sail>
$include <flow.sail>

val print = "print_endline" : string -> unit

val test : unit -> bool effect {escape}

function test () = {
  assert(false);
  false
}

val main : unit -> unit effect {escape}

function main () = {
  if false & test() then {
    print("unreachable");
  } else {
    print("ok");
  }
}