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

Testsuite gains incremental linking option for LTO

New `dg-lto-do incr-link` directive allows testing LTO incremental linking modes.

The GCC testsuite has gained a new directive, dg-lto-do incr-link, to facilitate testing of LTO’s incremental linking capabilities. This complements the existing dg-lto-do ar-link option, providing broader coverage for LTO’s various linking strategies. Documentation for the LTO testsuite has been updated accordingly.

In Details

The LTO test framework (lib/lto.exp) now supports the dg-lto-do incr-link directive. This allows test cases to explicitly exercise LTO's incremental linking modes, similar to how dg-lto-do ar-link tests linking LTO objects into an archive prior to the final link. This addition enhances testability for LTO's build pipeline integration.

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.
incremental linking
A build process where only changed or new code is re-linked, rather than relinking the entire project. In the context of LTO, this refers to specific modes of integrating object files during the link phase.
directive
A special command or instruction within a test case file that controls how the test runner executes or interprets the test.
Filed Under: ltotestsuitetesting