S+poonceonces.litmus 462 B

12345678910111213141516171819202122232425262728
  1. C S+poonceonces
  2. (*
  3. * Result: Sometimes
  4. *
  5. * Starting with a two-process release-acquire chain ordering P0()'s
  6. * first store against P1()'s final load, if the smp_store_release()
  7. * is replaced by WRITE_ONCE() and the smp_load_acquire() replaced by
  8. * READ_ONCE(), is ordering preserved?
  9. *)
  10. {}
  11. P0(int *x, int *y)
  12. {
  13. WRITE_ONCE(*x, 2);
  14. WRITE_ONCE(*y, 1);
  15. }
  16. P1(int *x, int *y)
  17. {
  18. int r0;
  19. r0 = READ_ONCE(*y);
  20. WRITE_ONCE(*x, 1);
  21. }
  22. exists (x=2 /\ 1:r0=1)