From: Siddhesh Poyarekar Date: Thu, 19 Dec 2024 13:09:15 +0000 (-0500) Subject: testsuite/118127: Pass fortran tests on ppc64le for IEEE128 long doubles X-Git-Tag: releases/gcc-14.3.0~539 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50c111ecd1ae8eb8af0e7938305de7af892ba9ab;p=thirdparty%2Fgcc.git testsuite/118127: Pass fortran tests on ppc64le for IEEE128 long doubles Denormal behaviour is well defined for IEEE128 long doubles, so XFAIL some gfortran tests only for targets with the IBM128 long double ABI. gcc/testsuite/ChangeLog: PR testsuite/118127 * lib/target-supports.exp (check_effective_target_long_double_is_ibm128): New procedure. * gfortran.dg/default_format_2.f90: xfail for long_double_is_ibm128. * gfortran.dg/default_format_denormal_2.f90: Likewise. * gfortran.dg/large_real_kind_form_io_2.f90: Likewise. Signed-off-by: Siddhesh Poyarekar (cherry picked from commit d4d4e874dee2d5b0abe5ceb9f2a78e5602e86030) --- diff --git a/gcc/testsuite/gfortran.dg/default_format_2.f90 b/gcc/testsuite/gfortran.dg/default_format_2.f90 index 5ad7b3a6429..dd04d3aae98 100644 --- a/gcc/testsuite/gfortran.dg/default_format_2.f90 +++ b/gcc/testsuite/gfortran.dg/default_format_2.f90 @@ -1,4 +1,4 @@ -! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } } +! { dg-do run { xfail long_double_is_ibm128 } } ! { dg-require-effective-target fortran_large_real } ! Test XFAILed on these platforms because the system's printf() lacks ! proper support for denormalized long doubles. See PR24685 diff --git a/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 b/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 index e9ccf5e8f61..ae056d506a2 100644 --- a/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 +++ b/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 @@ -1,4 +1,4 @@ -! { dg-do run { xfail powerpc*-*-* } } +! { dg-do run { xfail long_double_is_ibm128 } } ! { dg-require-effective-target fortran_large_real } ! Test XFAILed on this platform because the system's printf() lacks ! proper support for denormalized long doubles. See PR24685 diff --git a/gcc/testsuite/gfortran.dg/large_real_kind_form_io_2.f90 b/gcc/testsuite/gfortran.dg/large_real_kind_form_io_2.f90 index 34b8aec462c..7b5ca645b62 100644 --- a/gcc/testsuite/gfortran.dg/large_real_kind_form_io_2.f90 +++ b/gcc/testsuite/gfortran.dg/large_real_kind_form_io_2.f90 @@ -1,4 +1,4 @@ -! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } } +! { dg-do run { xfail long_double_is_ibm128 } } ! Test XFAILed on these platforms because the system's printf() lacks ! proper support for denormalized long doubles. See PR24685 ! { dg-require-effective-target fortran_large_real } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index be303e300dc..f8856846f02 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1817,6 +1817,20 @@ proc check_effective_target_fortran_integer_16 { } { }] } +# Check if long double on the target defaults to the IBM extended format. + +proc check_effective_target_long_double_is_ibm128 { } { + if { ![istarget powerpc*-*-*] } { + return 0 + } + + return [check_no_compiler_messages long_double_is_ibm128 assembly { + #ifndef __LONG_DOUBLE_IBM128__ + #error "__LONG_DOUBLE_IBM128__ not defined" + #endif + }] +} + # Return 1 if we can statically link libgfortran, 0 otherwise. # # When the target name changes, replace the cached result.