testsuite: Adjust nextafter and skip profile-info-section on AIX.
authorDavid Edelsohn <dje.gcc@gmail.com>
Wed, 25 Nov 2020 18:53:37 +0000 (13:53 -0500)
committerDavid Edelsohn <dje.gcc@gmail.com>
Thu, 26 Nov 2020 01:36:01 +0000 (20:36 -0500)
nextafter-2.c builds nextafter-1.c with math.h, but nextafter-1.c
provides prototypes for the functions.  The prototypes can conflict
with the definitions in math.h.  This patch omits the prototypes
when compiling nextafer-2.c.

profile-info-section.c uses the profile-info-section flag that is not
valid on AIX, so skip the test on AIX.

gcc/testsuite/ChangeLog:

* gcc.dg/nextafter-1.c: Omit prototypes if _NEXT_AFTER_2 defined.
* gcc.dg/nextafter-2.c: Define _NEXT_AFTER_2.
* gcc.dg/profile-info-section.c: Skip on AIX.

gcc/testsuite/gcc.dg/nextafter-1.c
gcc/testsuite/gcc.dg/nextafter-2.c
gcc/testsuite/gcc.dg/profile-info-section.c

index 1916ac29ad94b49c0faf4f9d0f7230fb8e10ff3c..646a741151b64bf0fd50ac78a1e3fd832211b9b5 100644 (file)
@@ -6,12 +6,14 @@
 /* { dg-final { scan-tree-dump-not "nextafter" "optimized" } } */
 /* { dg-final { scan-tree-dump-not "nexttoward" "optimized" } } */
 
+#ifndef _NEXT_AFTER_2
 float nextafterf (float, float);
 double nextafter (double, double);
 long double nextafterl (long double, long double);
 float nexttowardf (float, long double);
 double nexttoward (double, long double);
 long double nexttowardl (long double, long double);
+#endif
 
 #define CHECK(x) if (!(x)) __builtin_abort ()
 
index 8149a709fa5f0934694fd6712aa96a4ddff1a43d..b36bc8bb7e2579514f689b5fc1adefe98ac8f52c 100644 (file)
@@ -25,4 +25,7 @@
 #  define NO_LONG_DOUBLE 1
 # endif
 #endif
+
+#define _NEXT_AFTER_2
+
 #include "nextafter-1.c"
index c27fe17084e712578d7c561bb163fdf0afc7c475..8f31f3b2c07da92e52c493e6b40bef824817e135 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-do compile } */
+/* { dg-skip-if "profile-info-section" { powerpc-ibm-aix* } } */
 /* { dg-options "-fprofile-arcs -fprofile-info-section -fdump-tree-optimized" } */
 
 int foo()