summaryrefslogtreecommitdiff
path: root/test/c
diff options
context:
space:
mode:
Diffstat (limited to 'test/c')
-rw-r--r--test/c/cfold_reg.expect1
-rw-r--r--test/c/cfold_reg.sail30
2 files changed, 31 insertions, 0 deletions
diff --git a/test/c/cfold_reg.expect b/test/c/cfold_reg.expect
new file mode 100644
index 00000000..27ba77dd
--- /dev/null
+++ b/test/c/cfold_reg.expect
@@ -0,0 +1 @@
+true
diff --git a/test/c/cfold_reg.sail b/test/c/cfold_reg.sail
new file mode 100644
index 00000000..a5090e91
--- /dev/null
+++ b/test/c/cfold_reg.sail
@@ -0,0 +1,30 @@
+default Order dec
+
+$include <prelude.sail>
+
+val "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")
+ }
+} \ No newline at end of file