Libstdc++: Add test for unsupported engine range for 128-bit floats.
This change adds a test case to libstdc++ to verify that `std::generate_canonical` does not support certain non-power-of-two ranges when used with 128-bit floa…
This commit adds a test case to libstdc++ that checks the behavior of std::generate_canonical when used with 128-bit floating-point numbers. The test confirms that generators producing ranges of non-power-of-two sizes that span specific bit lengths are not supported. This limitation arises because the required intermediate integer calculations would exceed 128 bits, necessitating 256-bit integer support.
In Details
This patch adds a test for PR libstdc++/119739. std::generate_canonical's implementation has limitations when generating non-power-of-two ranges for 128-bit floats, specifically when the range spans certain bit lengths. The test checks that these unsupported ranges are correctly identified. This is related to the P0952 specification.
For Context
std::generate_canonical is a C++ standard library function used to generate uniformly distributed floating-point numbers. It relies on a random number generator to produce the bits of the floating-point number. For 128-bit floating-point numbers, the implementation has limitations in handling certain ranges of numbers, particularly those that are not powers of two. This test ensures that the library correctly identifies and handles these unsupported cases, preventing unexpected behavior or errors when generating random numbers.