Add ppc_ieee128_ok target-supports proc
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Tue, 11 Feb 2020 20:01:59 +0000 (14:01 -0600)
committerWill Schmidt <will_schmidt@vnet.ibm.com>
Tue, 11 Feb 2020 20:01:59 +0000 (14:01 -0600)
  Add a target_supports entry to check that the __ieee128 keyword
is understood by the target.
Also add a dg-requires check to the existing pr92796 testcase.

    [testsuite]
* lib/target-supports.exp (check_effective_target_ppc_ieee128_ok): New.
* gcc.target/powerpc/pr92796.c: Add a require-effective-target
statement for ppc_ieee128_ok.

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr92796.c
gcc/testsuite/lib/target-supports.exp

index 4f591539a9529a2047421a7e46b6281011e38e9f..8120020e315b4e52e23d18be0be5a659238d5bcf 100644 (file)
@@ -1,3 +1,9 @@
+2020-02-11  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * lib/target-supports.exp (check_effective_target_ppc_ieee128_ok): New.
+       * gcc.target/powerpc/pr92796.c: Add a require-effective-target
+       statement for ppc_ieee128_ok.
+
 2020-02-11  David Malcolm  <dmalcolm@redhat.com>
 
        PR analyzer/93374
index aa15b2d07e5383b8042d83b3e6b9b242847528cb..da4b6a47a6aefe187ea6ce68f33c00f8c363cfdc 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-protector-strong -mcpu=power8" } */
+/* { dg-require-effective-target ppc_ieee128_ok } */
 
 typedef union
 {
index d3b2798df3e8779730566ad13755237e21fa5ecf..fb177c54aa8247af525154736dc8c2637f8e4c2c 100644 (file)
@@ -2250,6 +2250,25 @@ proc check_ppc_float128_hw_available { } {
     }]
 }
 
+# See if the __ieee128 keyword is understood.
+proc check_effective_target_ppc_ieee128_ok { } {
+    return [check_cached_effective_target ppc_ieee128_ok {
+       # disable on AIX.
+       if { [istarget *-*-aix*] } {
+           expr 0
+       } else {
+           set options "-mfloat128"
+           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.