summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2014-07-03 03:22:45 +0200
committerGravatar wuestholz <unknown>2014-07-03 03:22:45 +0200
commitbebfbaa98ac099cba47cfd1f02e6781ea257997f (patch)
treeecc198613e10399f0a7aaf8ff033229e0ffc55c8
parent61f46d7b7789290098361c2de7e775fbe487bd7f (diff)
Changed "dummy" checksums to "stable" and added more tests for the verification result caching.
-rw-r--r--Source/Dafny/Translator.cs4
-rw-r--r--Test/dafny0/snapshots/Snapshots0.v1.dfy2
-rw-r--r--Test/dafny0/snapshots/Snapshots1.v0.dfy13
-rw-r--r--Test/dafny0/snapshots/Snapshots1.v1.dfy13
-rw-r--r--Test/dafny0/snapshots/Snapshots2.v0.dfy19
-rw-r--r--Test/dafny0/snapshots/Snapshots2.v1.dfy19
-rw-r--r--Test/dafny0/snapshots/runtest.snapshot2
-rw-r--r--Test/dafny0/snapshots/runtest.snapshot.expect20
8 files changed, 88 insertions, 4 deletions
diff --git a/Source/Dafny/Translator.cs b/Source/Dafny/Translator.cs
index 39b1ea95..854883c8 100644
--- a/Source/Dafny/Translator.cs
+++ b/Source/Dafny/Translator.cs
@@ -398,13 +398,13 @@ namespace Microsoft.Dafny {
var impl = decl as Implementation;
if (impl != null && impl.FindStringAttribute("checksum") == null)
{
- impl.AddAttribute("checksum", "dummy");
+ impl.AddAttribute("checksum", "stable");
}
var func = decl as Bpl.Function;
if (func != null && func.FindStringAttribute("checksum") == null)
{
- func.AddAttribute("checksum", "dummy");
+ func.AddAttribute("checksum", "stable");
}
}
}
diff --git a/Test/dafny0/snapshots/Snapshots0.v1.dfy b/Test/dafny0/snapshots/Snapshots0.v1.dfy
index 28f9f283..db9fc01a 100644
--- a/Test/dafny0/snapshots/Snapshots0.v1.dfy
+++ b/Test/dafny0/snapshots/Snapshots0.v1.dfy
@@ -1,7 +1,7 @@
method foo()
{
bar();
- assert false;
+ assert false; // error
}
method bar()
diff --git a/Test/dafny0/snapshots/Snapshots1.v0.dfy b/Test/dafny0/snapshots/Snapshots1.v0.dfy
new file mode 100644
index 00000000..dd1e7deb
--- /dev/null
+++ b/Test/dafny0/snapshots/Snapshots1.v0.dfy
@@ -0,0 +1,13 @@
+method M()
+{
+ N();
+ assert false;
+}
+
+method N()
+ ensures P;
+
+predicate P
+{
+ false
+}
diff --git a/Test/dafny0/snapshots/Snapshots1.v1.dfy b/Test/dafny0/snapshots/Snapshots1.v1.dfy
new file mode 100644
index 00000000..93ad6068
--- /dev/null
+++ b/Test/dafny0/snapshots/Snapshots1.v1.dfy
@@ -0,0 +1,13 @@
+method M()
+{
+ N();
+ assert false; // error
+}
+
+method N()
+ ensures P;
+
+predicate P
+{
+ true
+}
diff --git a/Test/dafny0/snapshots/Snapshots2.v0.dfy b/Test/dafny0/snapshots/Snapshots2.v0.dfy
new file mode 100644
index 00000000..37b9982b
--- /dev/null
+++ b/Test/dafny0/snapshots/Snapshots2.v0.dfy
@@ -0,0 +1,19 @@
+method M()
+{
+ N();
+ assert false;
+}
+
+method N()
+ ensures P;
+
+predicate P
+ ensures P == Q;
+
+predicate Q
+ ensures Q == R;
+
+predicate R
+{
+ false
+}
diff --git a/Test/dafny0/snapshots/Snapshots2.v1.dfy b/Test/dafny0/snapshots/Snapshots2.v1.dfy
new file mode 100644
index 00000000..03719744
--- /dev/null
+++ b/Test/dafny0/snapshots/Snapshots2.v1.dfy
@@ -0,0 +1,19 @@
+method M()
+{
+ N();
+ assert false; // error
+}
+
+method N()
+ ensures P;
+
+predicate P
+ ensures P == Q;
+
+predicate Q
+ ensures Q == R;
+
+predicate R
+{
+ true
+}
diff --git a/Test/dafny0/snapshots/runtest.snapshot b/Test/dafny0/snapshots/runtest.snapshot
index 6d2f880f..c3cf6b00 100644
--- a/Test/dafny0/snapshots/runtest.snapshot
+++ b/Test/dafny0/snapshots/runtest.snapshot
@@ -1,2 +1,2 @@
-// RUN: %dafny /compile:0 /verifySnapshots:2 /verifySeparately Snapshots0.dfy > "%t"
+// RUN: %dafny /compile:0 /verifySnapshots:2 /verifySeparately Snapshots0.dfy Snapshots1.dfy Snapshots2.dfy > "%t"
// RUN: %diff "%s.expect" "%t"
diff --git a/Test/dafny0/snapshots/runtest.snapshot.expect b/Test/dafny0/snapshots/runtest.snapshot.expect
index 7906e7a5..87827811 100644
--- a/Test/dafny0/snapshots/runtest.snapshot.expect
+++ b/Test/dafny0/snapshots/runtest.snapshot.expect
@@ -1,7 +1,27 @@
+-------------------- Snapshots0.dfy --------------------
+
Dafny program verifier finished with 3 verified, 0 errors
Snapshots0.v1.dfy(4,10): Error: assertion violation
Execution trace:
(0,0): anon0
Dafny program verifier finished with 2 verified, 1 error
+
+-------------------- Snapshots1.dfy --------------------
+
+Dafny program verifier finished with 4 verified, 0 errors
+Snapshots1.v1.dfy(4,10): Error: assertion violation
+Execution trace:
+ (0,0): anon0
+
+Dafny program verifier finished with 3 verified, 1 error
+
+-------------------- Snapshots2.dfy --------------------
+
+Dafny program verifier finished with 6 verified, 0 errors
+Snapshots2.v1.dfy(4,10): Error: assertion violation
+Execution trace:
+ (0,0): anon0
+
+Dafny program verifier finished with 5 verified, 1 error