-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c757390
commit 9b2c33e
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
src/test/resources/oldpermsemantics/issues/silicon_894.vpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Any copyright is dedicated to the Public Domain. | ||
// http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
|
||
field f: Int | ||
|
||
@exhaleMode("mce") | ||
method foo(x: Ref, y: Ref) | ||
{ | ||
inhale acc(x.f) && acc(y.f) | ||
|
||
var myseq: Seq[Ref] := Seq(x, y) | ||
|
||
assert forall r: Ref :: r in myseq ==> fn(r) > 2 | ||
|
||
//:: ExpectedOutput(assert.failed:assertion.false) | ||
assert false | ||
} | ||
|
||
@exhaleMode("mce") | ||
function fn(x: Ref): Int | ||
requires acc(x.f, wildcard) | ||
{5} | ||
|
||
@exhaleMode("mce") | ||
function foo1(x: Ref, y: Ref, z: Ref, b: Bool): Int | ||
requires b ? acc(x.f) : acc(y.f) | ||
requires b ? z == x : z == y | ||
requires bar(z) > 2 | ||
{5} | ||
|
||
@exhaleMode("mce") | ||
function foo2(x: Ref, y: Ref, z: Ref, b: Bool): Int | ||
requires acc(x.f) && acc(y.f) | ||
requires z == x || z == y | ||
requires bar(z) > 2 | ||
{5} | ||
|
||
@exhaleMode("mce") | ||
function foo3(x: Ref, y: Ref, z: Ref, b: Bool): Int | ||
requires acc(x.f, b ? write : none) && acc(y.f, b ? none : write) | ||
requires (z == x && b && z != y) || (z == y && !b && z != x) | ||
requires bar(z) > 2 | ||
{5} | ||
|
||
|
||
@exhaleMode("mce") | ||
function bar(x: Ref): Int | ||
requires acc(x.f, wildcard) | ||
{ | ||
5 | ||
} | ||
|
||
@exhaleMode("mce") | ||
method caller1(x: Ref, y: Ref) | ||
{ | ||
inhale acc(x.f) && acc(y.f) | ||
var res: Int | ||
res := foo1(x, y, x, true) | ||
res := foo1(x, y, y, false) | ||
//:: ExpectedOutput(assert.failed:assertion.false) | ||
assert false | ||
} | ||
|
||
@exhaleMode("mce") | ||
method caller2(x: Ref, y: Ref) | ||
{ | ||
inhale acc(x.f) && acc(y.f) | ||
var res: Int | ||
res := foo2(x, y, x, true) | ||
res := foo2(x, y, y, false) | ||
//:: ExpectedOutput(assert.failed:assertion.false) | ||
assert false | ||
} | ||
|
||
@exhaleMode("mce") | ||
method caller3(x: Ref, y: Ref) | ||
{ | ||
inhale acc(x.f) && acc(y.f) | ||
var res: Int | ||
res := foo3(x, y, x, true) | ||
res := foo3(x, y, y, false) | ||
//:: ExpectedOutput(assert.failed:assertion.false) | ||
assert false | ||
} |