summaryrefslogtreecommitdiff
path: root/test/c
diff options
context:
space:
mode:
Diffstat (limited to 'test/c')
-rw-r--r--test/c/downcast_fn.expect1
-rw-r--r--test/c/downcast_fn.sail23
2 files changed, 24 insertions, 0 deletions
diff --git a/test/c/downcast_fn.expect b/test/c/downcast_fn.expect
new file mode 100644
index 00000000..9766475a
--- /dev/null
+++ b/test/c/downcast_fn.expect
@@ -0,0 +1 @@
+ok
diff --git a/test/c/downcast_fn.sail b/test/c/downcast_fn.sail
new file mode 100644
index 00000000..d4b8ae5d
--- /dev/null
+++ b/test/c/downcast_fn.sail
@@ -0,0 +1,23 @@
+default Order dec
+
+$include <flow.sail>
+
+val f1 : forall 'n, 0 < 'n <= 8. int('n) -> unit
+
+function f1(_) = ()
+
+val f2 : forall 'n, 'n > 0. int('n) -> unit
+
+function f2(width) =
+ if 'n <= 8 then
+ f1(width)
+ else ()
+
+val "print" : string -> unit
+
+val main : unit -> unit
+
+function main() = {
+ f2(3);
+ print("ok\n")
+}