From 0b953f52eb8ee07e21f4174690e5b01be572d88a Mon Sep 17 00:00:00 2001 From: qunyanm Date: Tue, 31 Mar 2015 13:24:10 -0700 Subject: Fix issue #62. Check for modifies clause and constructors in the enclosing class when determining whether a method named Main() is the program entry. --- Test/dafny4/Bug62.dfy | 27 +++++++++++++++++++++++++++ Test/dafny4/Bug62.dfy.expect | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 Test/dafny4/Bug62.dfy create mode 100644 Test/dafny4/Bug62.dfy.expect (limited to 'Test') 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 -- cgit v1.2.3