summaryrefslogtreecommitdiff
path: root/test/c/cfold_reg.sail
blob: 53066bf59c10a4dfa3f0b6def7ce8eca76958131 (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
25
26
27
28
29
30
default Order dec

$include <prelude.sail>

val eq_string = { lem: "eq", _: "eq_string" } : (string, string) -> bool

overload operator == = {eq_string}

register R : bool

val "print_endline" : string -> unit

function IMPDEF(str : string) -> bool = {
  if str == "A" then {
    return(R)
  } else if str == "B" then {
    true
  } else {
    false
  }
}

function main(() : unit) -> unit = {
  R = true;
  if IMPDEF("A") then {
    print_endline("true")
  } else {
    print_endline("false")
  }
}