Fix tests that require IBM 128-bit long double
commit4c5d76a655b9abdacaa992ab1167b33d35c3ffe9
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 25 Aug 2021 23:25:12 +0000 (25 19:25 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 25 Aug 2021 23:25:12 +0000 (25 19:25 -0400)
tree05ac5f73fe56d0bff59097489c04ed7a500cc9d8
parentea5674687ac45fe7242c57220b699337899881f0
Fix tests that require IBM 128-bit long double

This patch adds 3 more selections to target-supports.exp to see if we can
specify to use a particular long double format (IEEE 128-bit, IBM extended
double, 64-bit), and the library support will track the changes for the long
double.  This is needed because two of the tests in the test suite use long
double, and they are actually testing IBM extended double.

This patch also forces the two tests that explicitly require long double
to use the IBM double-double encoding to explicitly run the test.  This
requires GLIBC 2.32 or greater in order to do the switch.

I have run tests on a little endian power9 system with 3 compilers.  There were
no regressions with these patches, and the two tests in the following patches
now work if the default long double is not IBM 128-bit:

 * One compiler used the default IBM 128-bit format;
 * One compiler used the IEEE 128-bit format; (and)
 * One compiler used 64-bit long doubles.

I have also tested compilers on a big endian power8 system with a compiler
defaulting to power8 code generation and another with the default cpu
set.  There were no regressions.

2021-08-25  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
PR target/94630
* gcc.target/powerpc/pr70117.c: Specify that we need the long double
type to be IBM 128-bit.  Remove the code to use __ibm128.
* c-c++-common/dfp/convert-bfp-11.c: Specify that we need the long
double type to be IBM 128-bit.  Run the test at -O2 optimization.
* lib/target-supports.exp (add_options_for_long_double_ibm128): New
function.
(check_effective_target_long_double_ibm128): New function.
(add_options_for_long_double_ieee128): New function.
(check_effective_target_long_double_ieee128): New function.
(add_options_for_long_double_64bit): New function.
(check_effective_target_long_double_64bit): New function.
gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c
gcc/testsuite/gcc.target/powerpc/pr70117.c
gcc/testsuite/lib/target-supports.exp