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
/
SB+poonceonces.litmus
blob
c92211ecbfdf70b6b820585b4e59f78f7d106637
1
C SB+poonceonces
2
3
(*
4
* Result: Sometimes
5
*
6
* This litmus test demonstrates that at least some ordering is required
7
* to order the store-buffering pattern, where each process writes to the
8
* variable that the preceding process reads.
9
*)
10
11
{
12
int x;
13
int y;
14
}
15
16
P0(int *x, int *y)
17
{
18
int r0;
19
20
WRITE_ONCE(*x, 1);
21
r0 = READ_ONCE(*y);
22
}
23
24
P1(int *x, int *y)
25
{
26
int r0;
27
28
WRITE_ONCE(*y, 1);
29
r0 = READ_ONCE(*x);
30
}
31
32
exists (0:r0=0 /\ 1:r0=0)