Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Testsuites   [Contents][Index]


6.4 C Language Testsuites

GCC contains the following C language testsuites, in thegcc/testsuite directory:

gcc.dg

This contains tests of particular features of the C compiler, using themore modern ‘dg’ harness. Correctness tests for various compilerfeatures should go here if possible.

Magic comments determine whether the fileis preprocessed, compiled, linked or run. In these tests, error and warningmessage texts are compared against expected texts or regular expressionsgiven in comments. These tests are run with the options ‘-ansi -pedantic’unless other options are given in the test. Except as noted below theyare not run with multiple optimization options.

gcc.dg/compat

This subdirectory contains tests for binary compatibility usinglib/compat.exp, which in turn uses the language-independent support(seeSupport for testing binary compatibility).

gcc.dg/cpp

This subdirectory contains tests of the preprocessor.

gcc.dg/debug

This subdirectory contains tests for debug formats. Tests in thissubdirectory are run for each debug format that the compiler supports.

gcc.dg/format

This subdirectory contains tests of the-Wformat formatchecking. Tests in this directory are run with and without-DWIDE.

gcc.dg/noncompile

This subdirectory contains tests of code that should not compile anddoes not need any special compilation options. They are run withmultiple optimization options, since sometimes invalid code crashesthe compiler with optimization.

gcc.dg/special

FIXME: describe this.

gcc.c-torture

This contains particular code fragments which have historically broken easily.These tests are run with multiple optimization options, so tests for featureswhich only break at some optimization levels belong here. This also containstests to check that certain optimizations occur. It might be worthwhile toseparate the correctness tests cleanly from the code quality tests, butit hasn’t been done yet.

gcc.c-torture/compat

FIXME: describe this.

This directory should probably not be used for new tests.

gcc.c-torture/compile

This testsuite contains test cases that should compile, but do notneed to link or run. These test cases are compiled with severaldifferent combinations of optimization options. All warnings aredisabled for these test cases, so this directory is not suitable ifyou wish to test for the presence or absence of compiler warnings.While special options can be set, and tests disabled on specificplatforms, by the use of.x files, mostly these test casesshould not contain platform dependencies. FIXME: discuss how definessuch asSTACK_SIZE are used.

gcc.c-torture/execute

This testsuite contains test cases that should compile, link and run;otherwise the same comments as forgcc.c-torture/compile apply.

gcc.c-torture/execute/ieee

This contains tests which are specific to IEEE floating point.

gcc.c-torture/unsorted

FIXME: describe this.

This directory should probably not be used for new tests.

gcc.misc-tests

This directory contains C tests that require special handling. Someof these tests have individual expect files, and others sharespecial-purpose expect files:

bprob*.c

Test-fbranch-probabilities usinggcc.misc-tests/bprob.exp, whichin turn uses the generic, language-independent framework(seeSupport for testing profile-directedoptimizations).

gcov*.c

Testgcov output usinggcov.exp, which in turn uses thelanguage-independent support (seeSupport for testing gcov).

i386-pf-*.c

Test i386-specific support for data prefetch usingi386-prefetch.exp.

gcc.test-framework
dg-*.c

Test the testsuite itself usinggcc.test-framework/test-framework.exp.

FIXME: merge intestsuite/README.gcc and discuss the format oftest cases and magic comments more.


Next:Support for testing link-time optimizations, Previous:Ada Language Testsuites, Up:Testsuites   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp