This directory contains tests for the GNU C compiler version 2.  The
tests are organized in several subdirectories, one for each kind of test.

  1. compile/ contains code that are just compiled and assembled.
  2. noncompile/ contains code that is incorrect and that should not
     compile without error an message.
  3. execute/ contains code that is compiled and executed.  The tests are
     written to return a zero exit status if they are successful.  N.B. Make
     sure that the compiler you test is installed properly.  Otherwise you
     are likely to get spurious failures because the compiler uses the wrong
     include files, or the wrong assembler.
  4. special/ contains test cases that require special switches, or
     otherwise don't fit in any of the other categories.
  5. unsorted/ contains test similar to the test in compile/.  Some of
     the test will be useful to make into execute/-tests, however.  I'm
     doing this slowly.

To run the tests, use the `doit' scripts in the subdirectories.  Normally
you would do:

   cd <subdir>
   doit <compiler-spec>

were <subdir> is one of compile, execute, special, noncompile, unsorted.
From c-torture-1.7 the compile, unsorted, and execute tests can be
performed from another directory by simply doing:

   cd foodir
   <c-torture-path>/subdir/doit <compiler-spec>

This will write all temporary file into foodir instead of the
corresponding c-torture subdir.  Thius feature is useful for testing
many compilers in parallel (without needing to copy c-torture).

If you are testing a development version of GCC in ".../gccdir", you
would typically type:

   doit ".../gccdir/xgcc -B.../gccdir/"

Since that is such a common case, the scripts also allow you to type:

   doit .../gccdir

If you are testing many compiler variants, like for example cross
compilers, you can specify them all at once, in either of these ways:

   doit ".../gccdir1/xgcc -B.../gccdir1/" ".../gccdir2/xgcc -B.../gccdir2/" ...
   doit .../gccdir1 .../gccdir2 ...

Without any argument `doit' defaults to `gcc'.

The `doit' scripts print on stdout the names of the files they test the
compiler with.  If a compiler bug is found, an error message is also
printed.  You will probably want to redirect the output to a log file.

If you get syntax errors for the `doit' scripts, it's probably because
your version of /bin/sh doesn't know about shell functions.  If this
happens to you, just type:

   bash doit <compiler-spec>

Please, please make more tests available for this package.  You can do it
by sending your test to tege@sics.se.  Your test should preferably either
reproduce a bug in the current version of GCC, or systematically test
some aspect of the compiler.

This package has mainly been assembled from GCC's users' bug reports.  It
has nothing to do with any other packages with similar names.  Indeed, I
have never seen or used any other C test package.

The latest version of this package can be found on sics.se.  The path is
/pub/gnu/c-torture-*.*.tar.Z.
