Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for Silicon issue 410 #846

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/test/resources/all/issues/silicon/0338.vpr
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,23 @@ method bar(x: Ref)
}
//:: ExpectedOutput(assert.failed:assertion.false)
assert false
}


field fx: Int
field fy: Int

method unsound(a: Ref)
requires acc(a.fx) && acc(a.fy)
ensures false
{
package acc(a.fx) --* (acc(a.fx) && acc(a.fy))

package acc(a.fx) --* (acc(a.fx) && acc(a.fy)) {
assert acc(a.fx, 2/1)
assert false // necessary to trigger unsoundness
}

//:: ExpectedOutput(assert.failed:insufficient.permission)
assert acc(a.fx) // shouldn't hold as we should have zero permissions
}
35 changes: 35 additions & 0 deletions src/test/resources/all/issues/silicon/0410.vpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/


field data: Int
field f: Int


method foo1(x: Ref)
requires acc(x.data)
{
package acc(x.data) --* false {
assert acc(x.data) && acc(x.data)
assert false
}

//:: ExpectedOutput(assert.failed:insufficient.permission)
assert acc(x.data)
}



method foo2(x: Ref)
requires acc(x.data)
{

var y: Int
package acc(x.data) --* false {
assert acc(x.data) && acc(x.data)
assert x.f > 0
}

//:: ExpectedOutput(assert.failed:insufficient.permission)
assert acc(x.data)
}
Loading