0001 C ISA2+poonceonces
0002
0003 (*
0004 * Result: Sometimes
0005 *
0006 * Given a release-acquire chain ordering the first process's store
0007 * against the last process's load, is ordering preserved if all of the
0008 * smp_store_release() invocations are replaced by WRITE_ONCE() and all
0009 * of the smp_load_acquire() invocations are replaced by READ_ONCE()?
0010 *)
0011
0012 {}
0013
0014 P0(int *x, int *y)
0015 {
0016 WRITE_ONCE(*x, 1);
0017 WRITE_ONCE(*y, 1);
0018 }
0019
0020 P1(int *y, int *z)
0021 {
0022 int r0;
0023
0024 r0 = READ_ONCE(*y);
0025 WRITE_ONCE(*z, 1);
0026 }
0027
0028 P2(int *x, int *z)
0029 {
0030 int r0;
0031 int r1;
0032
0033 r0 = READ_ONCE(*z);
0034 r1 = READ_ONCE(*x);
0035 }
0036
0037 exists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)