summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorNadrieril2024-05-27 17:33:56 +0200
committerNadrieril2024-05-28 11:36:31 +0200
commitc81c96f20b1dbf428a9ed42e83b910e798e1a225 (patch)
treeb01e01eb4bcec7112399647943047bed3b58cad1 /tests/src
parent9cc69020773cc77965a6faa6f0d46f179de3d8b8 (diff)
Add some tests
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/infinite-loop.rs11
-rw-r--r--tests/src/issue-194-recursive-struct-projector.rs16
-rw-r--r--tests/src/matches.rs10
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/infinite-loop.rs b/tests/src/infinite-loop.rs
new file mode 100644
index 00000000..906fc1fa
--- /dev/null
+++ b/tests/src/infinite-loop.rs
@@ -0,0 +1,11 @@
+//@ [coq,fstar,lean] skip
+//@ [coq,fstar] aeneas-args=-use-fuel
+//@ [coq,fstar] subdir=misc
+// FIXME: make it work
+fn bar() {}
+
+fn foo() {
+ loop {
+ bar()
+ }
+}
diff --git a/tests/src/issue-194-recursive-struct-projector.rs b/tests/src/issue-194-recursive-struct-projector.rs
new file mode 100644
index 00000000..9ebdc2bc
--- /dev/null
+++ b/tests/src/issue-194-recursive-struct-projector.rs
@@ -0,0 +1,16 @@
+//@ [coq,fstar] subdir=misc
+struct AVLNode<T> {
+ value: T,
+ left: AVLTree<T>,
+ right: AVLTree<T>,
+}
+
+type AVLTree<T> = Option<Box<AVLNode<T>>>;
+
+fn get_val<T>(x: AVLNode<T>) -> T {
+ x.value
+}
+
+fn get_left<T>(x: AVLNode<T>) -> AVLTree<T> {
+ x.left
+}
diff --git a/tests/src/matches.rs b/tests/src/matches.rs
new file mode 100644
index 00000000..5710a604
--- /dev/null
+++ b/tests/src/matches.rs
@@ -0,0 +1,10 @@
+//@ [coq] skip
+//@ [coq,fstar] subdir=misc
+//^ note: coq gives "invalid notation for pattern"
+fn match_u32(x: u32) -> u32 {
+ match x {
+ 0 => 0,
+ 1 => 1,
+ _ => 2,
+ }
+}