Skip to content
Open
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
13 changes: 13 additions & 0 deletions alloy/tests/PC-bar-acq-rel-atom.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Producer-Consumer pattern using named barriers.
// Atomic operations are non-private and thus the load and store are in locord.
// Barriers are acq_rel and thus they are in sw.
NEWWG
NEWSG
NEWTHREAD
ld.atom.scopewg.sc0 x = 1
cbar.acq.rel.scopewg.semsc0 0
NEWTHREAD
cbar.acq.rel.scopewg.semsc0 0
st.atom.scopewg.sc0 x = 1
NOSOLUTION consistent[X] && #dr=0
NOSOLUTION #dr>0
13 changes: 13 additions & 0 deletions alloy/tests/PC-bar-acq-rel-nonpriv.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Producer-Consumer pattern using named barriers.
// Load and store are non-private and thus in locord.
// Barriers are acq_rel and thus they are in sw.
NEWWG
NEWSG
NEWTHREAD
ld.nonpriv.sc0 x = 1
cbar.acq.rel.scopewg.semsc0 0
NEWTHREAD
cbar.acq.rel.scopewg.semsc0 0
st.nonpriv.sc0 x = 1
NOSOLUTION consistent[X] && #dr=0
NOSOLUTION #dr>0
13 changes: 13 additions & 0 deletions alloy/tests/PC-bar-acq-rel-priv.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Producer-Consumer pattern using named barriers.
// Load and store are private and thus not in locord.
// Barriers are acq_rel and thus they are in sw.
NEWWG
NEWSG
NEWTHREAD
ld.sc0 x = 1
cbar.acq.rel.scopewg.semsc0 0
NEWTHREAD
cbar.acq.rel.scopewg.semsc0 0
st.sc0 x = 1
SATISFIABLE consistent[X]
SATISFIABLE #dr>0
13 changes: 13 additions & 0 deletions alloy/tests/PC-bar-atom.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Producer-Consumer pattern using named barriers.
// Atomic operations are non-private and thus the load and store are in locord.
// Barriers are not acq_rel and thus they are not in sw.
NEWWG
NEWSG
NEWTHREAD
ld.atom.scopewg.sc0 x = 1
cbar.scopewg 0
NEWTHREAD
cbar.scopewg 0
st.atom.scopewg.sc0 x = 1
SATISFIABLE consistent[X] && #dr=0
NOSOLUTION #dr>0
13 changes: 13 additions & 0 deletions alloy/tests/PC-bar-nonpriv.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Producer-Consumer pattern using named barriers.
// Load and store are non-private and thus in locord.
// Barriers are not acq_rel and thus they are not in sw.
NEWWG
NEWSG
NEWTHREAD
ld.nonpriv.sc0 x = 1
cbar.scopewg 0
NEWTHREAD
cbar.scopewg 0
st.nonpriv.sc0 x = 1
SATISFIABLE consistent[X]
SATISFIABLE #dr>0
21 changes: 21 additions & 0 deletions alloy/tests/asmo-weak.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Test if thread 3 and thread 4 can read updates to x in conflicting order
NEWWG
NEWSG
NEWTHREAD
st.sc0 x = 1
NEWWG
NEWSG
NEWTHREAD
st.sc0 x = 2
NEWWG
NEWSG
NEWTHREAD
ld.atom.scopedev.sc0 x = 1
ld.atom.scopedev.sc0 x = 2
NEWWG
NEWSG
NEWTHREAD
ld.atom.scopedev.sc0 x = 2
ld.atom.scopedev.sc0 x = 1
SATISFIABLE consistent[X] && #dr>0
SATISFIABLE consistent[X]
13 changes: 13 additions & 0 deletions alloy/tests/coww-rr.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Non-atomic memory operations may be observed by one thread in a different order than they were written by another thread
NEWWG
NEWSG
NEWTHREAD
st.sc0 x = 1
st.sc0 x = 2
NEWWG
NEWSG
NEWTHREAD
ld.sc0 x = 2
ld.sc0 x = 1
SATISFIABLE consistent[X]
NOSOLUTION consistent[X] && #dr=0
12 changes: 12 additions & 0 deletions alloy/tests/mp-avvis.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Av/Vis + Rel/Acq forbids the behavior
NEWWG
NEWSG
NEWTHREAD
st.av.scopedev.sc0 x = 1
st.atom.rel.scopewg.sc0.semsc0 y = 1
NEWSG
NEWTHREAD
ld.atom.acq.scopewg.sc0.semsc0 y = 1
ld.vis.scopedev.sc0 x = 0
NOSOLUTION consistent[X]
NOSOLUTION consistent[X] && #dr=0
12 changes: 12 additions & 0 deletions alloy/tests/mp-no-avvis.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Rel/Acq alone is not enough to forbid the behavior
NEWWG
NEWSG
NEWTHREAD
st.sc0 x = 1
st.atom.rel.scopewg.sc0.semsc0 y = 1
NEWSG
NEWTHREAD
ld.atom.acq.scopewg.sc0.semsc0 y = 1
ld.sc0 x = 0
SATISFIABLE consistent[X]
NOSOLUTION consistent[X] && #dr=0
13 changes: 13 additions & 0 deletions alloy/tests/sb2dv.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Adapted from Figure 5 of paper: Heterogeneous-race-free Memory Models
NEWWG
NEWSG
NEWTHREAD
st.atom.rel.scopewg.sc0.semsc0 x = 1
ld.atom.acq.scopedev.sc0.semsc0 y = 0
NEWWG
NEWSG
NEWTHREAD
st.atom.rel.scopewg.sc0.semsc0 y = 1
ld.atom.acq.scopedev.sc0.semsc0 x = 0
SATISFIABLE consistent[X] && #dr>0
NOSOLUTION consistent[X] && #dr=0
11 changes: 11 additions & 0 deletions alloy/tests/sb2wg.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Adapted from Figure 5 of paper: Heterogeneous-race-free Memory Models
NEWWG
NEWSG
NEWTHREAD
st.atom.rel.scopewg.sc0.semsc0 x = 1
ld.atom.acq.scopedev.sc0.semsc0 y = 0
NEWSG
NEWTHREAD
st.atom.rel.scopewg.sc0.semsc0 y = 1
ld.atom.acq.scopedev.sc0.semsc0 x = 0
SATISFIABLE consistent[X] && #dr=0