ARM testsuite: Rework fp16_ok effective target check for better flag handling
Improves the ARM testsuite's `arm_fp16_ok` target check to iteratively find suitable flags, fixing test case failures.
This commit revises the arm_fp16_ok effective target check in the ARM testsuite to improve its handling of compiler flags. Previously, it sometimes exited early or incorrectly rejected valid combinations of -mfpu and -march flags, leading to test failures. The rework makes it iterate through sets of flags, similar to other _ok checks, ensuring that a working combination is found and allowing previously failing tests related to FP16 support to pass.
In Details
The lib/target-supports.exp in the GCC testsuite manages target support checks. This patch modifies check_effective_target_arm_fp16_ok_nocache to iterate through flag combinations rather than relying on a single check. This addresses issues where -mfpu=auto or specific -mfpu overrides were causing premature rejections, even when a compatible -march was present. The new approach mirrors arm_neon_ok and correctly identifies effective targets for FP16 support, resolving failures in tests like fp16-compile-vcvt.c and vect-half-floats.c.
- effective target
- The specific combination of CPU, architecture, and feature flags that the compiler is configured to target for a given test case.
- testsuite
- A collection of test programs and scripts used to verify the correctness and functionality of the compiler.
- DejaGnu
- A testing framework that provides a unified interface for executing tests and analyzing their results.
- FP16
- Half-precision floating-point format, using 16 bits to represent floating-point numbers.
- dg-options
- A special directive used in GCC testsuite files to specify compiler options that should be applied to a particular test case.