File tree Expand file tree Collapse file tree
src/test/resources/all/issues/silicon Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,4 +45,22 @@ method bar(x: Ref)
4545 }
4646 //:: ExpectedOutput(assert.failed:assertion.false)
4747 assert false
48- }
48+ }
49+
50+
51+ field fx: Int
52+ field fy: Int
53+
54+ method unsound(a: Ref)
55+ requires acc(a.fx) && acc(a.fy)
56+ {
57+ package acc(a.fx) --* (acc(a.fx) && acc(a.fy))
58+
59+ package acc(a.fx) --* (acc(a.fx) && acc(a.fy)) {
60+ assert acc(a.fx, 2/1)
61+ assert false // necessary to trigger unsoundness
62+ }
63+
64+ //:: ExpectedOutput(assert.failed:insufficient.permission)
65+ assert acc(a.fx) // shouldn't hold as we should have zero permissions
66+ }
Original file line number Diff line number Diff line change 1+ // Any copyright is dedicated to the Public Domain.
2+ // http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
5+ field data: Int
6+ field f: Int
7+
8+
9+ method foo1(x: Ref)
10+ requires acc(x.data)
11+ {
12+ package acc(x.data) --* false {
13+ assert acc(x.data) && acc(x.data)
14+ assert acc(x.data, 2/1)
15+ assert false
16+ }
17+
18+ //:: ExpectedOutput(assert.failed:insufficient.permission)
19+ assert acc(x.data)
20+ }
21+
22+
23+
24+ method foo2(x: Ref)
25+ requires acc(x.data)
26+ {
27+
28+ var y: Int
29+ package acc(x.data) --* false {
30+ assert acc(x.data) && acc(x.data)
31+ assert acc(x.data, 2/1)
32+ assert x.f > 0
33+ }
34+
35+ //:: ExpectedOutput(assert.failed:insufficient.permission)
36+ assert acc(x.data)
37+ }
You can’t perform that action at this time.
0 commit comments