summaryrefslogtreecommitdiff
path: root/Test/dafny0/CallStmtTests.dfy
diff options
context:
space:
mode:
authorGravatar Jason Koenig <unknown>2011-07-06 14:10:11 -0700
committerGravatar Jason Koenig <unknown>2011-07-06 14:10:11 -0700
commit89d9632457db76c9246b2d9cd88103238ad8f373 (patch)
treeb2bbd9f50e5195a9f4bcc799a7e24ebd8f62e843 /Test/dafny0/CallStmtTests.dfy
parent80ec1a41fc8b7109c8fc45eff6d9acf29851562d (diff)
Dafny: Fixed bug in call statements where mutability of out parameters was not checked.
Added regression test.
Diffstat (limited to 'Test/dafny0/CallStmtTests.dfy')
-rw-r--r--Test/dafny0/CallStmtTests.dfy21
1 files changed, 21 insertions, 0 deletions
diff --git a/Test/dafny0/CallStmtTests.dfy b/Test/dafny0/CallStmtTests.dfy
new file mode 100644
index 00000000..735efe81
--- /dev/null
+++ b/Test/dafny0/CallStmtTests.dfy
@@ -0,0 +1,21 @@
+
+method testing1(t: int)
+{
+ t := m(); // error: should be checked at the Dafny level, not fall to Boogie.
+}
+
+method m() returns (r: int)
+{
+ return 3;
+}
+
+method testing2()
+{
+ var v;
+ v := m2(); // error: v needs to be ghost because r is.
+}
+
+method m2() returns (ghost r: int)
+{
+ r := 23;
+}