From: Michael Meissner Date: Fri, 20 Nov 2020 23:34:24 +0000 (-0500) Subject: Include math.h in nextafter-2.c test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81a3f3d1b6fecc10ba8c460644dfb9ebabbb9eec;p=gcc.git 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 * gcc.dg/nextafter-2.c: Include math.h. --- 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 +/* 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 + #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) # if !__GLIBC_PREREQ (2, 24) /* Workaround buggy nextafterl in glibc 2.23 and earlier,