Support for torture testing using multiple options#
Throughout the compiler testsuite there are several directories whose
tests are run multiple times, each with a different set of options.
These are known as torture tests.
lib/torture-options.exp defines procedures to
set up these lists:
torture-initInitialize use of torture lists.
set-torture-optionsSet lists of torture options to use for tests with and without loops. Optionally combine a set of torture options with a set of other options, as is done with Objective-C runtime options.
torture-finishFinalize use of torture lists.
The .exp file for a set of tests that use torture options must
include calls to these three procedures if:
It calls
gcc-dg-runtestand overridesDG_TORTURE_OPTIONS.It calls
${tool}-tortureor${tool}-torture-execute, wheretoolisc,fortran, orobjc.It calls
dg-pch.
It is not necessary for a .exp file that calls gcc-dg-runtest
to call the torture procedures if the tests should use the list in
DG_TORTURE_OPTIONS defined in gcc-dg.exp.
Most uses of torture options can override the default lists by defining
TORTURE_OPTIONS or add to the default list by defining
ADDITIONAL_TORTURE_OPTIONS. Define these in a .dejagnurc
file or add them to the site.exp file; for example
set ADDITIONAL_TORTURE_OPTIONS [list \
{ -O2 -ftree-loop-linear } \
{ -O2 -fpeel-loops } ]