CoRW+poonceonce+Once.litmus 324 B

12345678910111213141516171819202122232425
  1. C CoRW+poonceonce+Once
  2. (*
  3. * Result: Never
  4. *
  5. * Test of read-write coherence, that is, whether or not a read from
  6. * a given variable and a later write to that same variable are ordered.
  7. *)
  8. {}
  9. P0(int *x)
  10. {
  11. int r0;
  12. r0 = READ_ONCE(*x);
  13. WRITE_ONCE(*x, 1);
  14. }
  15. P1(int *x)
  16. {
  17. WRITE_ONCE(*x, 2);
  18. }
  19. exists (x=2 /\ 0:r0=2)