repo.or.cz
/
linux
/
fpc-iii.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
WIP FPC-III support
[linux/fpc-iii.git]
/
tools
/
memory-model
/
litmus-tests
/
WRC+poonceonces+Once.litmus
blob
431494708611bfe41cfd744d2b132516e30e536e
1
C WRC+poonceonces+Once
2
3
(*
4
* Result: Sometimes
5
*
6
* This litmus test is an extension of the message-passing pattern,
7
* where the first write is moved to a separate process. Note that this
8
* test has no ordering at all.
9
*)
10
11
{
12
int x;
13
int y;
14
}
15
16
P0(int *x)
17
{
18
WRITE_ONCE(*x, 1);
19
}
20
21
P1(int *x, int *y)
22
{
23
int r0;
24
25
r0 = READ_ONCE(*x);
26
WRITE_ONCE(*y, 1);
27
}
28
29
P2(int *x, int *y)
30
{
31
int r0;
32
int r1;
33
34
r0 = READ_ONCE(*y);
35
r1 = READ_ONCE(*x);
36
}
37
38
exists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)