+2020-05-05  Michael Meissner  <meissner@linux.ibm.com>
+
+       (ieee128-lib-patch006b)
+       * gcc.dg/nextafter-2.c: Add support for long double being IEEE
+       128-bit on PowerPC systems.
+
 2020-05-05   Michael Meissner  <meissner@linux.ibm.com>
 
        Clone branch
 
 #  define NO_LONG_DOUBLE 1
 # endif
 #endif
+
+#if defined(_ARCH_PPC) && defined(__LONG_DOUBLE_IEEE128__)
+/* On PowerPC systems, long double uses either the IBM long double format, or
+   IEEE 128-bit format.  The compiler switches the long double built-in
+   function names and glibc switches the names when math.h is included.
+   Because this test is run with -fno-builtin, include math.h so that the
+   appropriate nextafter functions are called.  */
+#include <math.h>
+#endif
+
 #include "nextafter-1.c"