public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-5217] Include math.h in nextafter-2.c test.
Date: Fri, 20 Nov 2020 23:39:36 +0000 (GMT)	[thread overview]
Message-ID: <20201120233936.391363854804@sourceware.org> (raw)

https://gcc.gnu.org/g:81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec

commit r11-5217-g81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Fri Nov 20 18:34:24 2020 -0500

    Include math.h in nextafter-2.c test.
    
    Since the test is compiled with -fno-builtin, include math.h to allow for
    implementations (like the PowerPC) that have multiple versions of long double
    that are selectable by switch.  Math.h could possibly switch what function
    nextafterl points to.
    
    gcc/testsuite/
    2020-11-17  Michael Meissner  <meissner@linux.ibm.com>
    
            * gcc.dg/nextafter-2.c: Include math.h.

Diff:
---
 gcc/testsuite/gcc.dg/nextafter-2.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/nextafter-2.c b/gcc/testsuite/gcc.dg/nextafter-2.c
index e51ae94be0c..8149a709fa5 100644
--- a/gcc/testsuite/gcc.dg/nextafter-2.c
+++ b/gcc/testsuite/gcc.dg/nextafter-2.c
@@ -6,6 +6,18 @@
 
 #include <stdlib.h>
 
+/* In order to run on systems like the PowerPC that have 3 different long
+   double types, include math.h so it can choose what is the appropriate
+   nextafterl function to use.
+
+   If we didn't use -fno-builtin for this test, the PowerPC compiler would have
+   changed the names of the built-in functions that use long double.  The
+   nextafter-1.c function runs with this mapping.
+
+   Since this test uses -fno-builtin, include math.h, so that math.h can make
+   the appropriate choice to use.  */
+#include <math.h>
+
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
 # if !__GLIBC_PREREQ (2, 24)
 /* Workaround buggy nextafterl in glibc 2.23 and earlier,


                 reply	other threads:[~2020-11-20 23:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201120233936.391363854804@sourceware.org \
    --to=meissner@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).