[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-dev] wishlist: option to disable globals

Older versions of OpenCL do not support global variables, so in CLsmith we pass would-be globals around in a struct - every function takes a pointer to this struct as its final argument. We then compute a checksum based on the final contents of the struct. Might this be a useful feature to port to regular Csmith as an option?



On 31/05/2016 00:28, Yang Chen wrote:
Hi Jamey,

On 05/29/2016 11:40 PM, Jamey Sharp wrote:
Hi! John Regehr said I should bring this up here: I'd like to have a
csmith option to not generate or use global variables, or at least to
generate only read-only globals. Any chance someone feels like
implementing that?

I just committed some code that allows the generator to not generate global variables if --no-global-variables is passed. See if it works for you. Note that with --no-global-variables, all the generated programs will produce the same checksum 0, because we compute checksums using global variables.

- Yang