Hi,
Pardon:( I didn't understand sir, what you meant by "error is obvious ".
We have implemented in the code base of csmith the extension for
computed-goto as :
EXPECTED:
AFTER USING :
$ ./csmith --computed-goto > filename.c
{
/*BLOCK 2 */
/*
NUMBER OF GOTO'S IN ABOVEE BLOCK:1*/
void *target[] = { &&lbl_3919};
......statements
......statements
......statements
......statements
lbl_3919:
......statements
goto *target[0];
......statements
......statements
......statements
}
ACTUAL (error code):
AFTER USING :
$ ./csmith --computed-goto --output filename.c
$ /*
NUMBER OF GOTO'S IN ABOVEE BLOCK:1*/
void *target[] = { &&lbl_3919};
{
/*BLOCK 2 */
//THIS STATEMENT IS PRINTED ON TERMINAL when used with --output.
......statements
......statements
......statements
......statements
lbl_3919:
......statements
goto *target[0];
......statements
......statements
......statements
}
The above error causes when using --output and not when redirecting it
directly into a file.
On 1/4/19, John Regehr <regehr@cs.utah.edu> wrote:
> Hi Sameeran, this is a defect in your pull request that must be fixed.
> Just look for "ABOVEE" in your code and the error is obvious.
>
> John
>
>
> On 1/4/19 8:01 AM, sameeran joshi wrote:
>> Hi,
>> We modified the script for finding the coverage for old and extended
>> csmith.
>>
>> 1.It randomly chooses one of the extensions from a set of all
>> implemented extensions ,generates program based on above extension.
>> 2.Uses same seed from above program but generates another program
>> without extension.
>> 3.We compile both programs using 2 different compiler sources, built
>> with --enable-coverage .
>>
>> repeat above steps for some 10,000 programs
>> (so that may be 20% be of one kind of extension, another 25% of some
>> other kind , and so on.... for all extensions which we implemented)
>>
>> 4.find coverage using lcov at end for both the compiler built sources
>> files and find the gain .
>>
>> I am facing a strange problem for csmith , where
>> if I use --output as command line which is supposed to simply
>> redirect the output to some file, it's redirecting the extension's
>> code, to terminal .And the *target[] is not
>> present in the filename.c. Which causes compilation errors.
>>
>> This code is for the --computed-goto extension which we submitted on
>> github as a pull request.
>>
>> The same error occurs for another extensions as well when we use
>> --output , where as when we try redirecting using '>' operator the
>> same error didn't occur.
>>
>> ERROR HERE:
>> $ ./csmith --computed-goto --output filename.c
>>
>> Following is output on terminal , which was supposed to be in
>> file,which causes compilation errors
>> /*
>> NUMBER OF GOTO'S IN ABOVEE BLOCK:1*/
>> void *target[] = { &&lbl_3919};
>> /*
>> NUMBER OF GOTO'S IN ABOVEE BLOCK:1*/
>> void *target[] = { &&lbl_3102};
>>
>> THIS WORKS FINE:
>>
>> $ ./csmith --computed-goto > filename.c
>> ~/workspace/csmith/src$
>>
>> How do I find why is it outputing such to STDOUT?
>>
>> Thanks,
>> Sameeran Joshi
>>
>