gccint: C Tests

1 
1 7.4 C Language Testsuites
1 =========================
1 
1 GCC contains the following C language testsuites, in the 'gcc/testsuite'
1 directory:
1 
1 'gcc.dg'
1      This contains tests of particular features of the C compiler, using
1      the more modern 'dg' harness.  Correctness tests for various
1      compiler features should go here if possible.
1 
1      Magic comments determine whether the file is preprocessed,
1      compiled, linked or run.  In these tests, error and warning message
1      texts are compared against expected texts or regular expressions
1      given in comments.  These tests are run with the options '-ansi
1      -pedantic' unless other options are given in the test.  Except as
1      noted below they are not run with multiple optimization options.
1 'gcc.dg/compat'
1      This subdirectory contains tests for binary compatibility using
1      'lib/compat.exp', which in turn uses the language-independent
11      support (⇒Support for testing binary compatibility compat
      Testing.).
1 'gcc.dg/cpp'
1      This subdirectory contains tests of the preprocessor.
1 'gcc.dg/debug'
1      This subdirectory contains tests for debug formats.  Tests in this
1      subdirectory are run for each debug format that the compiler
1      supports.
1 'gcc.dg/format'
1      This subdirectory contains tests of the '-Wformat' format checking.
1      Tests in this directory are run with and without '-DWIDE'.
1 'gcc.dg/noncompile'
1      This subdirectory contains tests of code that should not compile
1      and does not need any special compilation options.  They are run
1      with multiple optimization options, since sometimes invalid code
1      crashes the compiler with optimization.
1 'gcc.dg/special'
1      FIXME: describe this.
1 
1 'gcc.c-torture'
1      This contains particular code fragments which have historically
1      broken easily.  These tests are run with multiple optimization
1      options, so tests for features which only break at some
1      optimization levels belong here.  This also contains tests to check
1      that certain optimizations occur.  It might be worthwhile to
1      separate the correctness tests cleanly from the code quality tests,
1      but it hasn't been done yet.
1 
1 'gcc.c-torture/compat'
1      FIXME: describe this.
1 
1      This directory should probably not be used for new tests.
1 'gcc.c-torture/compile'
1      This testsuite contains test cases that should compile, but do not
1      need to link or run.  These test cases are compiled with several
1      different combinations of optimization options.  All warnings are
1      disabled for these test cases, so this directory is not suitable if
1      you wish to test for the presence or absence of compiler warnings.
1      While special options can be set, and tests disabled on specific
1      platforms, by the use of '.x' files, mostly these test cases should
1      not contain platform dependencies.  FIXME: discuss how defines such
1      as 'STACK_SIZE' are used.
1 'gcc.c-torture/execute'
1      This testsuite contains test cases that should compile, link and
1      run; otherwise the same comments as for 'gcc.c-torture/compile'
1      apply.
1 'gcc.c-torture/execute/ieee'
1      This contains tests which are specific to IEEE floating point.
1 'gcc.c-torture/unsorted'
1      FIXME: describe this.
1 
1      This directory should probably not be used for new tests.
1 'gcc.misc-tests'
1      This directory contains C tests that require special handling.
1      Some of these tests have individual expect files, and others share
1      special-purpose expect files:
1 
1      'bprob*.c'
1           Test '-fbranch-probabilities' using
1           'gcc.misc-tests/bprob.exp', which in turn uses the generic,
11           language-independent framework (⇒Support for testing
           profile-directed optimizations profopt Testing.).
1 
1      'gcov*.c'
1           Test 'gcov' output using 'gcov.exp', which in turn uses the
11           language-independent support (⇒Support for testing gcov
           gcov Testing.).
1 
1      'i386-pf-*.c'
1           Test i386-specific support for data prefetch using
1           'i386-prefetch.exp'.
1 
1 'gcc.test-framework'
1      'dg-*.c'
1           Test the testsuite itself using
1           'gcc.test-framework/test-framework.exp'.
1 
1  FIXME: merge in 'testsuite/README.gcc' and discuss the format of test
1 cases and magic comments more.
1