From patchwork Sat Jan 29 21:36:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 80963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BEF56B7103 for ; Sun, 30 Jan 2011 08:35:15 +1100 (EST) Received: (qmail 6224 invoked by alias); 29 Jan 2011 21:35:10 -0000 Received: (qmail 6067 invoked by uid 22791); 29 Jan 2011 21:35:09 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from out02.roch.ny.frontiernet.net (HELO out02.roch.ny.frontiernet.net) (66.133.183.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Jan 2011 21:35:04 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAFwWRE1Hc96T/2dsb2JhbACgEoRou3iFTgSFEw Received: from relay01.roch.ny.frontiernet.net ([66.133.182.164]) by out02.roch.ny.frontiernet.net with ESMTP; 29 Jan 2011 21:35:02 +0000 X-Previous-IP: 71.115.222.147 Received: from quava.localdomain (pool-71-115-222-147.spknwa.dsl-w.verizon.net [71.115.222.147]) by relay01.roch.ny.frontiernet.net (Postfix) with ESMTPA id 8F0CE3FEA5; Sat, 29 Jan 2011 21:35:01 +0000 (UTC) Message-ID: <4D44884A.9010808@frontier.com> Date: Sat, 29 Jan 2011 13:36:10 -0800 From: Jerry DeLisle User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: gfortran , gcc patches , Jakub Jelinek Subject: [patch, testsuite] PR47293 Real 16 NaN test Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, This patch adds a check in the test mechanism for dg-require-effective-target fortran_real_16. The patch also adds a new test case, nan_7.f90 which passes on x86-64. It should pass on PPC as well. There are some differences in the results between platforms for reading "NaN" so the test case masks out the bits that differ. OK for trunk? (This must go in after the NaN patch posted earlier for libquadmath. Regards, Jerry PS I will include a ChangeLog entry. Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 169374) +++ lib/target-supports.exp (working copy) @@ -945,6 +945,22 @@ proc check_effective_target_fortran_large_real { } }] } +# Return 1 if the target supports Fortran real kind real(16), +# 0 otherwise. Contrary to check_effective_target_fortran_large_real +# this checks for Real(16) only; the other returned real(10) if +# both real(10) and real(16) are available. +# +# When the target name changes, replace the cached result. + +proc check_effective_target_fortran_real_16 { } { + return [check_no_compiler_messages fortran_large_real executable { + ! Fortran + real(kind=16) :: x + x = cos (x) + end + }] +} + # Return 1 if the target supports Fortran integer kinds larger than # integer(8), 0 otherwise. # Index: gfortran.dg/nan_7.f90 =================================================================== --- gfortran.dg/nan_7.f90 (revision 0) +++ gfortran.dg/nan_7.f90 (revision 0) @@ -0,0 +1,15 @@ +! { dg-do run } +! { dg-options "-fno-range-check" } +! { dg-require-effective-target fortran_real_16 } +! { dg-require-effective-target fortran_integer_16 } +! PR47293 NAN not correctly read +character(len=200) :: str +real(16) :: r +integer(16) :: k2 +integer(16), parameter :: quietnan = 170099645085600953110659059745250344960 +r = 1.0 +str = 'NAN' ; read(str,*) r +k2 = transfer(r,k2) +k2 = iand(k2, z'fff80000000000000000000000000000') +if (k2.ne.quietnan) call abort +end