-
Notifications
You must be signed in to change notification settings - Fork 1
Matt Windsor edited this page Jan 8, 2019
·
3 revisions
The c command exposes various utilities for dealing with C and C/Litmus input conforming to act
's subset of C.
If a C preprocessor is configured, act c
will use it.
$ act c explain [FLAGS] [-litmus] path/to/c/litmus/file.litmus
$ act c explain [FLAGS] [-c] path/to/c/file.c
Currently, this command just reads in a C (or C/Litmus) file, tries to convert it to act
's subset, and then prints it back out.
By default, act
decides whether its input is C or C/Litmus by checking the file extension. To override this, use -c
or -litmus
.
$ act c delitmus [FLAGS] path/to/c/litmus/file.litmus
act delitmus
tries to convert a C/Litmus test to a flat C file, ready for compilation. Similarly to the sanitiser for assembly files, the de-litmusifier makes some minor changes to the litmus test:
- Thread-local variables are lifted to the global scope, and prefixed with
tN
, whereN
is the thread identifier; - Global variables are lifted from the init block to regular
atomic_int
declarations; - Thread function parameters carrying pointers to global variables are deleted;
- Since the type of global variables has therefore changed from
atomic_int*
toatomic_int
, references to them inside atomic actions are prefixed by&
.