GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
testsuite

testsuite, fortran: Use generic tests for hidden directives.

Improves Fortran test suite reliability by using generic matchers for symbol visibility.

This commit enhances the Fortran test suite by employing generic assembly checkers for hidden symbol directives. Previously, tests relied on object-format-specific representations of ‘hidden’ visibility, causing failures on platforms like Darwin where the defaults differed. By using generic matchers, the tests now correctly verify the presence or absence of hidden symbols across various object formats, ensuring consistent and reliable testing.

In Details

The Fortran testsuite's handling of symbol visibility directives (e.g., 'hidden') was brittle due to reliance on object-format-specific assembly output. This patch introduces generic assembly matchers to abstract away these differences, ensuring that tests for hidden symbols pass or fail consistently across different object file formats like ELF and Mach-O. This addresses test failures, such as bind_c_private_1.f90 on Darwin.

For Context
Symbol visibility
A property of a symbol (e.g., a function or variable name) that controls its scope and linkage. 'Hidden' visibility typically means the symbol is not exported and cannot be directly referenced from other shared objects or executables.
ELF
Executable and Linkable Format. A common standard file format for object files, executables, and shared libraries on many Unix-like systems.
Mach-O
Mach Object file format. The standard object file format used in macOS, iOS, and other Darwin-based operating systems.
COFF
Common Object File Format. An older object file format used on systems like Windows and some Unix variants.
Assembly checkers
Tools or routines within a test suite that examine the generated assembly code to verify specific instructions, register usage, or symbol properties.
Filed Under: testsuitefortranvisibilitycross-platform