summaryrefslogtreecommitdiff
path: root/Test/linear/async-bug.bpl
blob: ad7020adf3c4b666a4a70c4726da309fd218bb47 (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} {:layer 100} Initialize({:linear "tid"} tid:int)
requires{:layer 100} tid == GcTid;
{
    yield;
    assert{:layer 100} tid == GcTid;

    call GarbageCollect(tid);

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

    async call GarbageCollect(tid);

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

    async call GarbageCollect(tid);

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

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

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