Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion model/cpp2w.cat
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let pscb = ([SC] | [F & SC]; hb?); scb; ([SC] | hb? ; [F & SC])
let pscf = [F & SC]; (hb | hb; eco; hb); [F & SC]
let psc = pscb | pscf

let tecotsb = ([A]; (eco); [A])+; sb
let tecotsb = ([A]; (eco); [A \ NORETURN])+; sb

let cnf = ((W * _) | (_ * W)) & loc \ ((IW * _) | (_ * IW))
let dr = (cnf & ext) \ (hb | hb^-1 | A * A | tecotsb | tecotsb^-1)
Expand Down
16 changes: 16 additions & 0 deletions tests/mp/mp-fetch-add.litmus
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
C mp-fetch-add
{ [x] = 0; [y] = 0; }

P0 (int* x, int* y) {
atomic_store_explicit(x, 1, memory_order_relaxed);
atomic_thread_fence(memory_order_release);
atomic_store_explicit(y, 1, memory_order_relaxed);
}

P1 (int* x, int* y) {
int r1 = atomic_fetch_add_explicit(y, 1, memory_order_release);
atomic_thread_fence(memory_order_acquire);
int r0 = atomic_load_explicit(x, memory_order_relaxed);
}

exists (1:r0=0 /\ y=2)
16 changes: 16 additions & 0 deletions tests/mp/mp-store-add.litmus
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
C mp-store-add
{ [x] = 0; [y] = 0; }

P0 (int* x, int* y) {
atomic_store_explicit(x, 1, memory_order_relaxed);
atomic_thread_fence(memory_order_release);
atomic_store_explicit(y, 1, memory_order_relaxed);
}

P1 (int* x, int* y) {
atomic_store_add_explicit(y, 1, memory_order_release);
atomic_thread_fence(memory_order_acquire);
int r0 = atomic_load_explicit(x, memory_order_relaxed);
}

exists (1:r0=0 /\ y=2)