forked from Minki/linux
tools/memory-model: Add types to litmus tests
This commit adds type information for global variables in the litmus tests in order to allow easier use with klitmus7. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
0a27ce6b69
commit
1947bfcf81
@ -7,7 +7,9 @@ C CoRR+poonceonce+Once
|
|||||||
* reads from the same variable are ordered.
|
* reads from the same variable are ordered.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,9 @@ C CoRW+poonceonce+Once
|
|||||||
* a given variable and a later write to that same variable are ordered.
|
* a given variable and a later write to that same variable are ordered.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,9 @@ C CoWR+poonceonce+Once
|
|||||||
* given variable and a later read from that same variable are ordered.
|
* given variable and a later read from that same variable are ordered.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,9 @@ C CoWW+poonceonce
|
|||||||
* writes to the same variable are ordered.
|
* writes to the same variable are ordered.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,10 @@ C IRIW+fencembonceonces+OnceOnce
|
|||||||
* process? This litmus test exercises LKMM's "propagation" rule.
|
* process? This litmus test exercises LKMM's "propagation" rule.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,10 @@ C IRIW+poonceonces+OnceOnce
|
|||||||
* different process?
|
* different process?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,12 @@ C ISA2+pooncelock+pooncelock+pombonce
|
|||||||
* (in P0() and P1()) is visible to external process P2().
|
* (in P0() and P1()) is visible to external process P2().
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
spinlock_t mylock;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y, spinlock_t *mylock)
|
P0(int *x, int *y, spinlock_t *mylock)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,11 @@ C ISA2+poonceonces
|
|||||||
* of the smp_load_acquire() invocations are replaced by READ_ONCE()?
|
* of the smp_load_acquire() invocations are replaced by READ_ONCE()?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,11 @@ C ISA2+pooncerelease+poacquirerelease+poacquireonce
|
|||||||
* (AKA non-rf) link, so release-acquire is all that is needed.
|
* (AKA non-rf) link, so release-acquire is all that is needed.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,10 @@ C LB+fencembonceonce+ctrlonceonce
|
|||||||
* another control dependency and order would still be maintained.)
|
* another control dependency and order would still be maintained.)
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,10 @@ C LB+poacquireonce+pooncerelease
|
|||||||
* to the other?
|
* to the other?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,10 @@ C LB+poonceonces
|
|||||||
* be prevented even with no explicit ordering?
|
* be prevented even with no explicit ordering?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,10 @@ C MP+fencewmbonceonce+fencermbonceonce
|
|||||||
* is usually better to use smp_store_release() and smp_load_acquire().
|
* is usually better to use smp_store_release() and smp_load_acquire().
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -10,8 +10,9 @@ C MP+onceassign+derefonce
|
|||||||
*)
|
*)
|
||||||
|
|
||||||
{
|
{
|
||||||
y=z;
|
int x;
|
||||||
z=0;
|
int *y=z;
|
||||||
|
int z=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
P0(int *x, int **y)
|
P0(int *x, int **y)
|
||||||
|
@ -11,6 +11,8 @@ C MP+polockmbonce+poacquiresilsil
|
|||||||
*)
|
*)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
spinlock_t lo;
|
||||||
|
int x;
|
||||||
}
|
}
|
||||||
|
|
||||||
P0(spinlock_t *lo, int *x)
|
P0(spinlock_t *lo, int *x)
|
||||||
|
@ -11,6 +11,8 @@ C MP+polockonce+poacquiresilsil
|
|||||||
*)
|
*)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
spinlock_t lo;
|
||||||
|
int x;
|
||||||
}
|
}
|
||||||
|
|
||||||
P0(spinlock_t *lo, int *x)
|
P0(spinlock_t *lo, int *x)
|
||||||
|
@ -11,7 +11,11 @@ C MP+polocks
|
|||||||
* to see all prior accesses by those other CPUs.
|
* to see all prior accesses by those other CPUs.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
spinlock_t mylock;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y, spinlock_t *mylock)
|
P0(int *x, int *y, spinlock_t *mylock)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,10 @@ C MP+poonceonces
|
|||||||
* no ordering at all?
|
* no ordering at all?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,10 @@ C MP+pooncerelease+poacquireonce
|
|||||||
* pattern.
|
* pattern.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,11 @@ C MP+porevlocks
|
|||||||
* see all prior accesses by those other CPUs.
|
* see all prior accesses by those other CPUs.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
spinlock_t mylock;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y, spinlock_t *mylock)
|
P0(int *x, int *y, spinlock_t *mylock)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,10 @@ C R+fencembonceonces
|
|||||||
* cause the resulting test to be allowed.
|
* cause the resulting test to be allowed.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,10 @@ C R+poonceonces
|
|||||||
* store propagation delays.
|
* store propagation delays.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,10 @@ C S+fencewmbonceonce+poacquireonce
|
|||||||
* store against a subsequent store?
|
* store against a subsequent store?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,10 @@ C S+poonceonces
|
|||||||
* READ_ONCE(), is ordering preserved?
|
* READ_ONCE(), is ordering preserved?
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,10 @@ C SB+fencembonceonces
|
|||||||
* suffice, but not much else.)
|
* suffice, but not much else.)
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,10 @@ C SB+poonceonces
|
|||||||
* variable that the preceding process reads.
|
* variable that the preceding process reads.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,10 @@ C SB+rfionceonce-poonceonces
|
|||||||
* This litmus test demonstrates that LKMM is not fully multicopy atomic.
|
* This litmus test demonstrates that LKMM is not fully multicopy atomic.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,10 @@ C WRC+poonceonces+Once
|
|||||||
* test has no ordering at all.
|
* test has no ordering at all.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,10 @@ C WRC+pooncerelease+fencermbonceonce+Once
|
|||||||
* is A-cumulative in LKMM.
|
* is A-cumulative in LKMM.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x)
|
P0(int *x)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,12 @@ C Z6.0+pooncelock+poonceLock+pombonce
|
|||||||
* by CPUs not holding that lock.
|
* by CPUs not holding that lock.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
spinlock_t mylock;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y, spinlock_t *mylock)
|
P0(int *x, int *y, spinlock_t *mylock)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,12 @@ C Z6.0+pooncelock+pooncelock+pombonce
|
|||||||
* seen as ordered by a third process not holding that lock.
|
* seen as ordered by a third process not holding that lock.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
spinlock_t mylock;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y, spinlock_t *mylock)
|
P0(int *x, int *y, spinlock_t *mylock)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,11 @@ C Z6.0+pooncerelease+poacquirerelease+fencembonceonce
|
|||||||
* involving locking.)
|
* involving locking.)
|
||||||
*)
|
*)
|
||||||
|
|
||||||
{}
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int z;
|
||||||
|
}
|
||||||
|
|
||||||
P0(int *x, int *y)
|
P0(int *x, int *y)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user