Hi, This adds a target_supports entry to check that the _ieee128 keyword is understood by the target. Also adds that require-effective-target check to the existing pr92796 testcase. Sniff tested on Linux (power6,power9) and AIX. OK for master?
Thanks -Will [testsuite] * lib/target-supports.exp (check_effective_target_ppc_ieee128_ok): New. * gcc.target/powerpc/pr92796.c: Add require-effective-target ppc64_ieee128_ok. diff --git a/gcc/testsuite/gcc.target/powerpc/pr92796.c b/gcc/testsuite/gcc.target/powerpc/pr92796.c index aa15b2d..da4b6a4 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr92796.c +++ b/gcc/testsuite/gcc.target/powerpc/pr92796.c @@ -1,7 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fstack-protector-strong -mcpu=power8" } */ +/* { dg-require-effective-target ppc_ieee128_ok } */ typedef union { __ieee128 a; int b; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index d3b2798..0154457 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2248,10 +2248,32 @@ proc check_ppc_float128_hw_available { } { } $options } }] } +# See if the __ieee128 keyword is understood. +proc check_effective_target_ppc_ieee128_ok { } { + return [check_cached_effective_target ppc_ieee128_ok { + # disable on Darwin, AIX. + if { [istarget powerpc-*-eabi] + || [istarget powerpc*-*-eabispe] + || [istarget *-*-darwin*] + || [istarget *-*-aix*] } { + expr 0 + } else { + set options "-mvsx" + check_runtime_nocache ppc_ieee128_ok { + int main() + { + __ieee128 a; + return 0; + } + } $options + } + }] +} + # Return 1 if the target supports executing VSX instructions, 0 # otherwise. Cache the result. proc check_vsx_hw_available { } { return [check_cached_effective_target vsx_hw_available {