GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
testsuite

Testsuite adds option to augment LTO test configurations

New `dg-lto-additional-options` directive simplifies adding options to LTO test configurations.

A new testsuite directive, dg-lto-additional-options, has been introduced to simplify the process of adding specific compiler flags to existing LTO test configurations. Previously, overriding options with dg-lto-options removed default configurations, making it cumbersome to add flags like -Wall. This new directive allows augmenting the default set of options, proving useful for testing features like LTO diagnostic pragmas.

In Details

The LTO test framework's lib/lto.exp now handles the dg-lto-additional-options directive. This allows test writers to append arbitrary flags to the standard set of LTO test options, rather than completely replacing them as dg-lto-options does. This is particularly useful for testing specific diagnostic behaviors with LTO, as it preserves the comprehensive default LTO test options while adding targeted flags.

For Context
LTO
Link-Time Optimization. A compilation technique where optimization occurs at link time rather than during individual compilation units, allowing for inter-procedural optimizations across the entire program.
testsuite
A collection of automated tests designed to verify the correctness of the compiler's behavior across various features, targets, and optimization levels.
directive
A special command or instruction within a test case file that controls how the test runner executes or interprets the test.
-Wall
A common compiler flag that enables a wide range of useful, but not necessarily critical, warning messages.
Filed Under: ltotestsuitetesting