xref: /linux/tools/memory-model/litmus-tests/R+poonceonces.litmus (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
11c27b644SPaul E. McKenneyC R+poonceonces
21c27b644SPaul E. McKenney
38f32543bSPaul E. McKenney(*
48f32543bSPaul E. McKenney * Result: Sometimes
58f32543bSPaul E. McKenney *
68f32543bSPaul E. McKenney * This is the unordered (thus lacking smp_mb()) version of one of the
78f32543bSPaul E. McKenney * classic counterintuitive litmus tests that illustrates the effects of
88f32543bSPaul E. McKenney * store propagation delays.
98f32543bSPaul E. McKenney *)
108f32543bSPaul E. McKenney
11*5c587f9bSAkira Yokosawa{}
121c27b644SPaul E. McKenney
131c27b644SPaul E. McKenneyP0(int *x, int *y)
141c27b644SPaul E. McKenney{
151c27b644SPaul E. McKenney	WRITE_ONCE(*x, 1);
161c27b644SPaul E. McKenney	WRITE_ONCE(*y, 1);
171c27b644SPaul E. McKenney}
181c27b644SPaul E. McKenney
191c27b644SPaul E. McKenneyP1(int *x, int *y)
201c27b644SPaul E. McKenney{
211c27b644SPaul E. McKenney	int r0;
221c27b644SPaul E. McKenney
231c27b644SPaul E. McKenney	WRITE_ONCE(*y, 2);
241c27b644SPaul E. McKenney	r0 = READ_ONCE(*x);
251c27b644SPaul E. McKenney}
261c27b644SPaul E. McKenney
271c27b644SPaul E. McKenneyexists (y=2 /\ 1:r0=0)
28