Skip to content

Commit dd76004

Browse files
authored
Adding regression test (#792)
1 parent 48e0ac8 commit dd76004

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

  • src/test/resources/all/issues/silicon
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
field f: Ref
5+
field g: Ref
6+
7+
function one(): Int {1}
8+
function two(): Int {2}
9+
10+
predicate Q(x: Ref)
11+
12+
predicate P(x: Ref) {
13+
forall i: Int :: one() == two() && x.f != null ==> acc(x.g.f)
14+
}
15+
16+
predicate P2(x: Ref) {
17+
forall i: Int :: one() == two() && x.f != null ==> Q(x.g)
18+
}
19+
20+
method consumeField(x: Ref)
21+
{
22+
exhale forall i: Int :: one() == two() && x.f != null ==> acc(x.g.f)
23+
//:: ExpectedOutput(assert.failed:assertion.false)
24+
assert false
25+
}
26+
27+
method produceField(x: Ref)
28+
{
29+
inhale P(x)
30+
unfold P(x)
31+
//:: ExpectedOutput(assert.failed:assertion.false)
32+
assert false
33+
}
34+
35+
method consumePred(x: Ref)
36+
{
37+
fold P2(x)
38+
//:: ExpectedOutput(assert.failed:assertion.false)
39+
assert false
40+
}
41+
42+
method producePred(x: Ref)
43+
{
44+
inhale forall i: Int :: one() == two() && x.f != null ==> Q(x.g)
45+
//:: ExpectedOutput(assert.failed:assertion.false)
46+
assert false
47+
}

0 commit comments

Comments
 (0)