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
/
R+poonceonces.litmus
blob
bcd5574e304ae762c0a32064e215b6a3d200fd38
1
C R+poonceonces
2
3
(*
4
* Result: Sometimes
5
*
6
* This is the unordered (thus lacking smp_mb()) version of one of the
7
* classic counterintuitive litmus tests that illustrates the effects of
8
* store propagation delays.
9
*)
10
11
{
12
int x;
13
int y;
14
}
15
16
P0(int *x, int *y)
17
{
18
WRITE_ONCE(*x, 1);
19
WRITE_ONCE(*y, 1);
20
}
21
22
P1(int *x, int *y)
23
{
24
int r0;
25
26
WRITE_ONCE(*y, 2);
27
r0 = READ_ONCE(*x);
28
}
29
30
exists (y=2 /\ 1:r0=0)