1C IRIW+fencembonceonces+OnceOnce
2
3(*
4 * Result: Never
5 *
6 * Test of independent reads from independent writes with smp_mb()
7 * between each pairs of reads.  In other words, is smp_mb() sufficient to
8 * cause two different reading processes to agree on the order of a pair
9 * of writes, where each write is to a different variable by a different
10 * process?  This litmus test exercises LKMM's "propagation" rule.
11 *)
12
13{
14	int x;
15	int y;
16}
17
18P0(int *x)
19{
20	WRITE_ONCE(*x, 1);
21}
22
23P1(int *x, int *y)
24{
25	int r0;
26	int r1;
27
28	r0 = READ_ONCE(*x);
29	smp_mb();
30	r1 = READ_ONCE(*y);
31}
32
33P2(int *y)
34{
35	WRITE_ONCE(*y, 1);
36}
37
38P3(int *x, int *y)
39{
40	int r0;
41	int r1;
42
43	r0 = READ_ONCE(*y);
44	smp_mb();
45	r1 = READ_ONCE(*x);
46}
47
48exists (1:r0=1 /\ 1:r1=0 /\ 3:r0=1 /\ 3:r1=0)
49