summaryrefslogtreecommitdiff
path: root/Test/dafny4
diff options
context:
space:
mode:
authorGravatar qunyanm <unknown>2015-03-31 13:24:10 -0700
committerGravatar qunyanm <unknown>2015-03-31 13:24:10 -0700
commit0b953f52eb8ee07e21f4174690e5b01be572d88a (patch)
tree2cf27d12107eb750d7e73b0185dd1808a8c0bc3b /Test/dafny4
parentb4b193a05571b243d50a832dae58e837e779b710 (diff)
Fix issue #62. Check for modifies clause and constructors in the enclosing
class when determining whether a method named Main() is the program entry.
Diffstat (limited to 'Test/dafny4')
-rw-r--r--Test/dafny4/Bug62.dfy27
-rw-r--r--Test/dafny4/Bug62.dfy.expect2
2 files changed, 29 insertions, 0 deletions
diff --git a/Test/dafny4/Bug62.dfy b/Test/dafny4/Bug62.dfy
new file mode 100644
index 00000000..016ee117
--- /dev/null
+++ b/Test/dafny4/Bug62.dfy
@@ -0,0 +1,27 @@
+// RUN: %dafny /compile:3 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+class C {
+ constructor C() { }
+ method Main() // not Main since the enclosing class has a constructor.
+ {
+ print "hello, I'm running ... in C\n";
+ }
+}
+
+class D {
+ method Main() // not Main since it has modifies clause.
+ modifies this;
+ {
+ print "hello, I'm running ... in D\n";
+ }
+}
+
+
+class E {
+ static method Main() // not Main since it has requires clause.
+ requires true;
+ {
+ print "hello, I'm running ... in E\n";
+ }
+}
diff --git a/Test/dafny4/Bug62.dfy.expect b/Test/dafny4/Bug62.dfy.expect
new file mode 100644
index 00000000..42fd56a5
--- /dev/null
+++ b/Test/dafny4/Bug62.dfy.expect
@@ -0,0 +1,2 @@
+
+Dafny program verifier finished with 8 verified, 0 errors