csmith-project / csmith

Csmith, a random generator of C programs
http://embed.cs.utah.edu/csmith/
Other
1.02k stars 146 forks source link

Generate specific statement #141

Open jordiae opened 3 years ago

jordiae commented 3 years ago

Hi, many thanks for your work. My use case is as follows: I need to generate random C code (ideally just one statement or expression) such that I can get a return value with a given type signature. My goal is to generate random function definitions given their signature.

For instance, fromint f(int x); obtain int f(int x) { return 5;}. Is it possible to use C-Smith for this purpose?

Many thanks in advance.