From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 317273858419; Sun, 5 Sep 2021 02:31:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 317273858419 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: e1LzWhN0avT4Df/ajmbDd9Iafcn52V0DyLs2QM/lsMM+EKzECSe0y/LAw77GASzReLNfR3LHRT pbrbGkDNMVWL/hs5SmPIDhAe/urVxSESGrPTi5znFr77BS7/Fs2RLgD44TPt2ArjOv/EbN16RD XuuM7Q7HFWjSH7fosX9c4nWJpZ9DQj+O16GKo5LqC3kkV1JKXCy4fXctmkTWBzizcjTb1tAmQI lbAff+2p+Hid+ePVDimjLQK20d0Ggu5bxouIsr2o/+lAiC/AKhur46HfsplkKWi9Y/Vl3ge+uP mr9VJ/coIe9fnIM44Zd8fWfg X-IronPort-AV: E=Sophos;i="5.85,269,1624348800"; d="scan'208";a="65695645" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 04 Sep 2021 18:31:06 -0800 IronPort-SDR: hTOrr3THQ2jfh6FbOSm72GgGICFAVlP9Qqi+eVMs36HdmStit9MLsETH49Vd3DbiFoCmkk9Aw3 rff3z12y/pl026Eesocveg90h+J/G69kjXv7T02OitUPBZ9B53a7Qq21r8rrif/V1honWdaRNg SM7koBpuOISINfHkKn2HeOEH/LYKLwSojLinis6cMurqEh6QTdWL6cIN3twVN8bnEOTnWQmdOM 5xNvV8jHJjE3mkYl/Uf3tOMzSAU1s0eM8rGDR3Ccmfgjh22iYHu9YN+nT1Msw4HPpw2JoyhRzh YAk= To: "fortran@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" From: Sandra Loosemore Subject: [PATCH, Fortran] Skip gfortran.dg/PR100914.f90 on targets that don't provide quadmath.h Message-ID: Date: Sat, 4 Sep 2021 20:30:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------0770CFE9BF5AD0F62BD8FAE2" Content-Language: en-US X-ClientProxiedBy: svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2021 02:31:10 -0000 --------------0770CFE9BF5AD0F62BD8FAE2 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit The testcase gfortran.dg/PR100914.f90 that I recently checked in (originally written by José Rui Faustino de Sousa) depends on the header file to obtain a typedef for __complex128. It appears not to be possible to define an equivalent type in a portable way in the testcase itself (see https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Floating-Types.html) so this patch skips the test entirely on targets where quadmath.h is not available. The target-supports.exp change was cut-and-pasted from similar code in that file, but I haven't figured out how to test this change in a build that doesn't provide quadmath.h (e.g., my aarch64-linux-gnu toolchain build attempt croaked with an unrelated compilation error in glibc). Perhaps someone who previously encountered the FAILs on this testcase can confirm that it's skipped with this change? -Sandra --------------0770CFE9BF5AD0F62BD8FAE2 Content-Type: text/x-patch; charset="UTF-8"; name="pr100914.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr100914.patch" commit 41fe3b50b3d92931fc99ef15f86cc9299e0c617e Author: Sandra Loosemore Date: Sat Sep 4 18:36:39 2021 -0700 Skip gfortran.dg/PR100914.f90 on targets that don't provide quadmath.h. This test uses the __complex128 type, which is provided by the header which may not be available on all targets. 2021-09-04 Sandra Loosemore gcc/testsuite/ * lib/target-supports.exp (check_effective_target_quadmath_h): New function. * gfortran.dg/PR100914.f90: Use it. Add comments. diff --git a/gcc/testsuite/gfortran.dg/PR100914.f90 b/gcc/testsuite/gfortran.dg/PR100914.f90 index 64b3335..aff405a 100644 --- a/gcc/testsuite/gfortran.dg/PR100914.f90 +++ b/gcc/testsuite/gfortran.dg/PR100914.f90 @@ -1,7 +1,10 @@ ! Fails on x86 targets where sizeof(long double) == 16. ! { dg-do run { xfail { { x86_64*-*-* i?86*-*-* } && longdouble128 } } } -! { dg-additional-sources PR100914.c } +! Requires Fortran support for __float128. ! { dg-require-effective-target fortran_real_c_float128 } +! Requires __complex128 type from quadmath.h. +! { dg-require-effective-target quadmath_h } +! { dg-additional-sources PR100914.c } ! ! Test the fix for PR100914 ! diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ad8f011..072b776 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8340,6 +8340,14 @@ proc check_effective_target_libc_has_complex_functions {} { }] } +# Return true if this target has the quadmath.h header. + +proc check_effective_target_quadmath_h {} { + return [check_no_compiler_messages quadmath_h object { + #include + }] +} + # Return 1 if # (a) an error of a few ULP is expected in string to floating-point # conversion functions; and --------------0770CFE9BF5AD0F62BD8FAE2--