intel / yarpgen

Yet Another Random Program Generator
Other
491 stars 53 forks source link

How to generate C codes #178

Closed khagankhan closed 1 year ago

khagankhan commented 1 year ago

How can I generate the C codes? Just the C codes themselves in a file, or stdout, etc? I would like to refer your code generator. All I need is just the valid, random C codes. How can I access it?

Great tool!

-Thanks

Vsevolod-Livinskij commented 1 year ago

After you build yarpgen, you can use the --std flag to select target language: ./yarpgen --std=c.

It will create func.c file with the test function, init.h file with external variables declaration, and driver.c file with the boilerplate code required to run the test. They can be optionally placed in the output folder if you pass -o out/ parameter.

Thank you! Please let us know if you manage to find bugs with yarpgen, it helps us to publish papers and keeps us motivated.