aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.ibm.com>2020-11-20 18:34:24 -0500
committerMichael Meissner <meissner@linux.ibm.com>2020-11-20 18:34:24 -0500
commit81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec (patch)
tree6d1568504b2d500a1f354249e88c1c967996f6a0 /gcc
parent9bdb34cebcb4f5a9dcebbb5895d1300c2f869cbf (diff)
downloadgcc-81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec.zip
gcc-81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec.tar.gz
gcc-81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/nextafter-2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/nextafter-2.c b/gcc/testsuite/gcc.dg/nextafter-2.c
index e51ae94..8149a70 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,