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

Re: [csmith-dev] How to generate fixed size program using Csmith



Hi Eric,

Thanks for your excellent answer and good advice. Yes, I don't require
the range to be very narrow, between 90K and 110K is ok.

Best Regards,
Shijun
Eric Eide <eeide@cs.utah.edu> 于2018年11月6日周二 下午11:34写道:
>
> shijun zhao <zqyzsj@gmail.com> writes:
>
> > Is there any way for Csmith to generate programs whose size (or the
> > lines of code) can be specified? Thanks.
>
> Hi!  No, there is no option that sets the exact size of the generated program.
>
> There are options that influence the possible (maximum) size of the generated
> programs.  These include:
>
>   --max-block-depth
>   --max-block-size
>   --max-expr-complexity
>   --max-funcs
>
> If you set these values higher, the generated programs can be bigger.
>
> The easiest way to generate programs in a particular size range is simply to
> generate a lot of programs and discard the ones that don't fall into the size
> range you want.
>
> Warning: If you have a very narrow range, you might have to run Csmith many,
> many times to get the total number of programs that you want!  My advice is to
> not make your ranges too narrow.  "Exactly 100K" is bad; "between 90K and 110K"
> is better.
>
> Happy hacking! ---
>
> Eric.
>
> --
> -------------------------------------------------------------------------------
> Eric Eide <eeide@cs.utah.edu>  .         University of Utah School of Computing
> http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX