build: testsuite: Generate effective targets from auto-host.h
Streamlines testsuite effective target generation using host configuration macros.
The GCC testsuite now generates its effective targets from auto-host.h, eliminating redundant checks and inconsistencies. A framework is introduced to automatically create check_effective_target_* procedures that mirror macros defined in auto-host.h. These definitions are read from et-static.def and processed to match the host configuration, ensuring consistency between the build environment and the tests. The changes also enhance the test_installed script to support different scenarios for using effective target definitions during installed testing.
In Details
This change refactors the testsuite's handling of effective targets. Instead of duplicating checks, it generates testsuite procedures (e.g., check_effective_target_ld_at_file) based on macros defined in auto-host.h. The process involves preprocessing et-static.def to define a simple record format, then scanning auto-host.h to populate these definitions into targets-support.exp. The contrib/test_installed script is updated to load these generated definitions, supporting testing of installed compilers against potentially different source tree configurations.
- effective target
- In the context of GCC's testsuite, an 'effective target' represents a specific configuration or feature set of the compiler and its environment that the tests are designed to verify.
- auto-host.h
- A header file generated by the configure script that contains macros defining properties of the host system (the system where GCC is being built).
- testsuite
- A collection of tests used to verify the correctness of the compiler.
- targets-support.exp
- A Tcl script file used by the GCC testsuite to manage and execute tests related to target configurations.
- installed testing
- Testing a GCC installation, typically by invoking the installed compiler and running its testsuite, as opposed to testing a compiler built from source.