On Wed, 2007-11-28 at 20:32 -0600, Sebastian Pop wrote:
> On Nov 28, 2007 6:36 PM, Janis Johnson <[EMAIL PROTECTED]> wrote:
> >
> > On Wed, 2007-11-28 at 15:00 -0600, Sebastian Pop wrote:
> > > Hi,
> > >
> > > In a recent update of the page http://gcc.gnu.org/wiki/Graphite I left
> > > the "Testing Lambda and Graphite frameworks" part in the open tasks.
> > > One of the subitems of this task is:
> > >
> > > "Add expect scripts for comparing outputs of testcases compiled with
> > > different options.  For instance compare output of a program compiled
> > > with "-O2" versus "-O2 -fgraphite"."
> > >
> > > Are there already such scripts that we could use?  I suspect that the
> > > answer is not yet.
> >
> > I'm not sure what you mean.  Would it be enough to add -fgraphite to
> > TORTURE_OPTIONS when you run the existing execute tests?
> >
> 
> Sorry for not being clear.
> 
> I want to compile twice a testcase once with an option turned on, and
> another time without that option: this produces two executables.  Then
> I want to compare the outputs of the two executables as they should be
> the same with and without the transformation.  Here is an example:
> 
> gcc -O2 -fgraphite file.c -o ./a
> gcc -O2 -fno-graphite file.c -o ./b
> ./a > output.a
> ./b > output.b
> diff output.a output.b
> 
> And there should be no difference between the outputs.
> 
> My question was whether we have an infrastructure in the gcc testsuite
> that allows to specify the flags to compare, something like:
> 
> /* { dg-same-output "-O2 -fgraphite" "-O2 -fno-graphite" } */
> 
> that would trigger the above commands and succeed when the outputs are
> identical.

Tests in the GCC testsuite are self-checking: they abort if the
results of computations aren't as expected, rather than writing
output that is then compared against expected output.  Most tests
don't depend on specific optimizations and so should pass with
whatever optimizations are used on them.  Torture tests are built
with a variety of optimizations and are expected to pass each
time.  There are sets of options that are used every time the
tests are run, and the person running the tests can override
those to use different, or additional, sets of options.

There are also groups of tests, like those in gcc.dg/vect and
gcc.dg/tree-ssa, that examine dump output to verify that expected
transformations have been done for particular code.

Does this help?  If I'm still missing something then perhaps an
example would help.

Janis

Reply via email to