summaryrefslogtreecommitdiff
path: root/Test/dafny0
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2011-12-10 10:56:42 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2011-12-10 10:56:42 -0800
commit9b914c44821a1709291a04b120d36cbfed7ff989 (patch)
tree6a8bad0625bae231b565c8bc1bba466bfb770d0b /Test/dafny0
parentf5a76b417ad345c611a267e75ca01fbff5658bd8 (diff)
Dafny: fix bug in translation of (the splitting of) if-then-else expressions (see bug report Issue 10214 on codeplex)
Diffstat (limited to 'Test/dafny0')
-rw-r--r--Test/dafny0/Answer5
-rw-r--r--Test/dafny0/SmallTests.dfy10
2 files changed, 14 insertions, 1 deletions
diff --git a/Test/dafny0/Answer b/Test/dafny0/Answer
index 1eb22708..8287c38b 100644
--- a/Test/dafny0/Answer
+++ b/Test/dafny0/Answer
@@ -243,8 +243,11 @@ Execution trace:
SmallTests.dfy(364,4): Error: cannot prove termination; try supplying a decreases clause
Execution trace:
(0,0): anon3_Else
+SmallTests.dfy(411,41): Error: possible violation of function postcondition
+Execution trace:
+ (0,0): anon6_Else
-Dafny program verifier finished with 47 verified, 20 errors
+Dafny program verifier finished with 47 verified, 21 errors
-------------------- Definedness.dfy --------------------
Definedness.dfy(8,7): Error: possible division by zero
diff --git a/Test/dafny0/SmallTests.dfy b/Test/dafny0/SmallTests.dfy
index 2074e484..041b51c1 100644
--- a/Test/dafny0/SmallTests.dfy
+++ b/Test/dafny0/SmallTests.dfy
@@ -402,3 +402,13 @@ class Test {
}
}
+
+// ------ an if-then-else regression test
+
+function F(b: bool): int
+ // The if-then-else in the following line was once translated incorrectly,
+ // incorrectly causing the postcondition to verify
+ ensures if b then F(b) == 5 else F(b) == 6;
+{
+ 5
+}