summaryrefslogtreecommitdiff
path: root/test/coq
diff options
context:
space:
mode:
authorBrian Campbell2019-03-15 16:39:43 +0000
committerBrian Campbell2019-03-15 18:42:09 +0000
commitc1f9e24213b50fb622ac94f816e304eabc75ba75 (patch)
tree11ee8b5ae1f4349879620241b729ea0ce653f96a /test/coq
parentd74ad78a26a92c054b93e4fdce9623d0fdca7edd (diff)
Add coq test case for for-loop type variable
Diffstat (limited to 'test/coq')
-rw-r--r--test/coq/_CoqProject2
-rw-r--r--test/coq/pass/foreach_using_tyvar.sail11
2 files changed, 13 insertions, 0 deletions
diff --git a/test/coq/_CoqProject b/test/coq/_CoqProject
new file mode 100644
index 00000000..a694372c
--- /dev/null
+++ b/test/coq/_CoqProject
@@ -0,0 +1,2 @@
+-R ../../../bbv/theories bbv
+-R ../../lib/coq/ Sail
diff --git a/test/coq/pass/foreach_using_tyvar.sail b/test/coq/pass/foreach_using_tyvar.sail
new file mode 100644
index 00000000..8aabe00c
--- /dev/null
+++ b/test/coq/pass/foreach_using_tyvar.sail
@@ -0,0 +1,11 @@
+$include <arith.sail>
+
+val f : forall 'n, 'n != 5. int('n) -> unit
+
+val magic : forall 'n. int('n) -> bool effect {rreg}
+
+val g : int -> unit effect {rreg}
+
+function g(x) =
+ foreach (n from 0 to x)
+ if n != 5 & magic(n) then f(n)