Skip to content

Commit

Permalink
Merge pull request #746 from viperproject/meilers_silicon_wand_issue_…
Browse files Browse the repository at this point in the history
…test

Adding test for a Silicon wand issue
  • Loading branch information
marcoeilers authored Oct 16, 2023
2 parents f80cbfa + 7edf26b commit 09956be
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/test/resources/all/issues/silicon/0338.vpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/


function otherFunc(s: Seq[Int], i: Int): Bool
requires |s| > 1
{
true
}

method foo(x: Ref, y: Ref, s: Seq[Int], i: Int)
{
package (|s| > 3 ? (i > 1 && i < |s| - 2 && otherFunc(s, i)) : (i > 1 && i < |s| - 2)) --* true {
}
//:: ExpectedOutput(assert.failed:assertion.false)
assert |s| > 0
}


field f: Int

predicate p(x:Ref) {acc(x.f)}

method tst(x: Ref)
requires acc(x.f, 1/2) && x.f == 3
{
package acc(x.f, 1/2) && x.f == 2 --* p(x)
{
fold p(x)
assert x.f == 3
}
//:: ExpectedOutput(assert.failed:assertion.false)
assert false
}

field data: Int

method bar(x: Ref)
requires acc(x.data)
{
package acc(x.data) --* false {
assert acc(x.data) && acc(x.data)
//:: UnexpectedOutput(assert.failed:assertion.false, /carbon/issue/470/)
assert false
}
//:: ExpectedOutput(assert.failed:assertion.false)
assert false
}

0 comments on commit 09956be

Please sign in to comment.