xref: /linux/tools/memory-model/litmus-tests/S+poonceonces.litmus (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
11c27b644SPaul E. McKenneyC S+poonceonces
21c27b644SPaul E. McKenney
38f32543bSPaul E. McKenney(*
48f32543bSPaul E. McKenney * Result: Sometimes
58f32543bSPaul E. McKenney *
68f32543bSPaul E. McKenney * Starting with a two-process release-acquire chain ordering P0()'s
78f32543bSPaul E. McKenney * first store against P1()'s final load, if the smp_store_release()
88f32543bSPaul E. McKenney * is replaced by WRITE_ONCE() and the smp_load_acquire() replaced by
98f32543bSPaul E. McKenney * READ_ONCE(), is ordering preserved?
108f32543bSPaul E. McKenney *)
118f32543bSPaul E. McKenney
12*5c587f9bSAkira Yokosawa{}
131c27b644SPaul E. McKenney
141c27b644SPaul E. McKenneyP0(int *x, int *y)
151c27b644SPaul E. McKenney{
161c27b644SPaul E. McKenney	WRITE_ONCE(*x, 2);
171c27b644SPaul E. McKenney	WRITE_ONCE(*y, 1);
181c27b644SPaul E. McKenney}
191c27b644SPaul E. McKenney
201c27b644SPaul E. McKenneyP1(int *x, int *y)
211c27b644SPaul E. McKenney{
221c27b644SPaul E. McKenney	int r0;
231c27b644SPaul E. McKenney
241c27b644SPaul E. McKenney	r0 = READ_ONCE(*y);
251c27b644SPaul E. McKenney	WRITE_ONCE(*x, 1);
261c27b644SPaul E. McKenney}
271c27b644SPaul E. McKenney
281c27b644SPaul E. McKenneyexists (x=2 /\ 1:r0=1)
29