testsuite: Fix up gcc.dg/torture/bitint-100.c test.
Ensures atomic operations on bit-integers are tested correctly for ARM targets.
This commit adjusts a test case (bitint-100.c) in GCC’s torture suite to correctly handle atomic operations on _BitInt(17) for ARM targets. Previously, this test could fail due to missing linker flags for atomic operations on specific ARM architectures. The fix ensures that the test also requires the sync_int_long effective target, which properly aligns the atomic operation requirements for the tested bit-integer size.
In Details
The test gcc.dg/torture/bitint-100.c uses atomic operations on _BitInt(17). On certain ARM targets like armv6s-m, standard atomic support might not be available or require specific linker flags. This patch adds a dg-require-effective-target sync_int_long directive to the test case. This ensures the test only runs on configurations where sync_int_long is supported, which implicitly covers the necessary atomic primitives for _BitInt(17) on platforms like ARM, preventing linkage errors.
- _BitInt(N)
- A GCC extension for arbitrary-precision integers, where N specifies the number of bits.
- torture suite
- A collection of test cases in GCC designed to stress-test specific compiler features or expose deep bugs, often involving complex or unusual code constructs.
- atomic operations
- Operations that are guaranteed to execute indivisibly, preventing race conditions in multithreaded environments. Examples include compare-and-swap.
- linker flags
- Options passed to the linker to control how object files are combined into an executable or library. For example,
-latomicmight be needed for atomic operations.