summaryrefslogtreecommitdiff
path: root/Test/linear/async-bug.bpl
blob: ff6cdded544bf51fc950b7db39d9167e3934e2d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// RUN: %boogie -noinfer -typeEncoding:m -useArrayTheory -doModSetAnalysis "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
const GcTid:int;

procedure {:yields} {:phase 100} Initialize({:linear "tid"} tid:int)
requires{:phase 100} tid == GcTid;
{
    yield;
    assert{:phase 100} tid == GcTid;

    call GarbageCollect(tid);

    yield;
    assert{:phase 100} tid == GcTid;

    async call GarbageCollect(tid);

    yield;
    assert{:phase 100} tid == GcTid;

    async call GarbageCollect(tid);

    yield;
    assert{:phase 100} tid == GcTid;

    yield;
    assert{:phase 100} tid == GcTid;
}

procedure {:yields} {:phase 100} GarbageCollect({:linear "tid"} tid:int)
requires{:phase 100} tid == GcTid;
{
    yield;
    assert{:phase 100} tid == GcTid;
}