Re: [PATCH v3 4/5] tools/memory-model: Switch to softcoded herd7 tags

From: Jonas Oberhauser
Date: Sat Sep 21 2024 - 03:39:45 EST


Thanks Akira for your continued eagle eyes!
Will include in next revision.

One question below.
jonas



Am 9/21/2024 um 4:44 AM schrieb Akira Yokosawa:
This litmus test is not compatible with klitmus7, which is much
stricter than herd7's C parser.

You can have only int or int* variables in the exists clause.
Register variables need their declarations at the top of each Pn()
(classic C).

See below for klitmus7 ready code.

And tools/memory-model/litmus-tests/README need to mention this
litmus test.

Thanks, Akira

---------------------------------------------
P0(int *x, int *y, atomic_t *z)
{
int r0;

WRITE_ONCE(*x, 1);
r0 = atomic_add_unless(z,1,5);
WRITE_ONCE(*y, 1);
}

P1(int *x, int *y)
{
int r0;

r0 = READ_ONCE(*y);
if (r0 == 1)
WRITE_ONCE(*x, 2);
}

exists (1:r0=1 /\ x=1)
---------------------------------------------


Should z also be changed from atomic_t to int?