summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorGravatar Clément Pit--Claudel <clement.pitclaudel@live.com>2015-08-22 20:05:57 -0700
committerGravatar Clément Pit--Claudel <clement.pitclaudel@live.com>2015-08-22 20:05:57 -0700
commitd0a06250f82efe318fcc0f7ce80d4286552fe727 (patch)
tree511b5abcf6e92f0ac39393e5a627a80477f1ea4e /Test
parentea5592cb3fade85b31a28a3119f5e637da47e72a (diff)
Add more wishes to the wishlist
Diffstat (limited to 'Test')
-rw-r--r--Test/wishlist/naked-function-in-recursive-setting.dfy13
-rw-r--r--Test/wishlist/naked-function-in-recursive-setting.dfy.expect8
-rw-r--r--Test/wishlist/useless-casts-in-decreases-clauses.dfy9
-rw-r--r--Test/wishlist/useless-casts-in-decreases-clauses.dfy.expect3
4 files changed, 33 insertions, 0 deletions
diff --git a/Test/wishlist/naked-function-in-recursive-setting.dfy b/Test/wishlist/naked-function-in-recursive-setting.dfy
new file mode 100644
index 00000000..650fc4c3
--- /dev/null
+++ b/Test/wishlist/naked-function-in-recursive-setting.dfy
@@ -0,0 +1,13 @@
+// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /printTooltips "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+function fact(n: int): int
+ requires n >= 0
+{
+ if n == 0 then
+ 1
+ else (
+ assert fact.requires(n-1); //WISH
+ n * fact(n-1)
+ )
+}
diff --git a/Test/wishlist/naked-function-in-recursive-setting.dfy.expect b/Test/wishlist/naked-function-in-recursive-setting.dfy.expect
new file mode 100644
index 00000000..4b1691b4
--- /dev/null
+++ b/Test/wishlist/naked-function-in-recursive-setting.dfy.expect
@@ -0,0 +1,8 @@
+naked-function-in-recursive-setting.dfy(4,9): Info: decreases n
+naked-function-in-recursive-setting.dfy(10,11): Error: cannot use naked function in recursive setting. Possible solution: eta expansion.
+Execution trace:
+ (0,0): anon0
+ (0,0): anon7_Else
+ (0,0): anon8_Else
+
+Dafny program verifier finished with 0 verified, 1 error
diff --git a/Test/wishlist/useless-casts-in-decreases-clauses.dfy b/Test/wishlist/useless-casts-in-decreases-clauses.dfy
new file mode 100644
index 00000000..9b002d47
--- /dev/null
+++ b/Test/wishlist/useless-casts-in-decreases-clauses.dfy
@@ -0,0 +1,9 @@
+// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /printTooltips "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+method M() {
+ var pos := 10;
+ while (pos > 0) { // This shouldn't print int(pos) - int(0); pos - 0 would be better
+ pos := pos - 1;
+ }
+}
diff --git a/Test/wishlist/useless-casts-in-decreases-clauses.dfy.expect b/Test/wishlist/useless-casts-in-decreases-clauses.dfy.expect
new file mode 100644
index 00000000..e37b8b9b
--- /dev/null
+++ b/Test/wishlist/useless-casts-in-decreases-clauses.dfy.expect
@@ -0,0 +1,3 @@
+useless-casts-in-decreases-clauses.dfy(6,2): Info: decreases int(pos) - int(0)
+
+Dafny program verifier finished with 2 verified, 0 errors