ISA2+poonceonces.litmus 598 B

12345678910111213141516171819202122232425262728293031323334353637
  1. C ISA2+poonceonces
  2. (*
  3. * Result: Sometimes
  4. *
  5. * Given a release-acquire chain ordering the first process's store
  6. * against the last process's load, is ordering preserved if all of the
  7. * smp_store_release() invocations are replaced by WRITE_ONCE() and all
  8. * of the smp_load_acquire() invocations are replaced by READ_ONCE()?
  9. *)
  10. {}
  11. P0(int *x, int *y)
  12. {
  13. WRITE_ONCE(*x, 1);
  14. WRITE_ONCE(*y, 1);
  15. }
  16. P1(int *y, int *z)
  17. {
  18. int r0;
  19. r0 = READ_ONCE(*y);
  20. WRITE_ONCE(*z, 1);
  21. }
  22. P2(int *x, int *z)
  23. {
  24. int r0;
  25. int r1;
  26. r0 = READ_ONCE(*z);
  27. r1 = READ_ONCE(*x);
  28. }
  29. exists (1:r0=1 /\ 2:r0=1 /\ 2:r1=0)