From 8f81f43f606cd915e96c857c007a4635fc0ea601 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Wed, 25 Nov 2020 13:53:37 -0500 Subject: [PATCH] testsuite: Adjust nextafter and skip profile-info-section on AIX. 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 | 2 ++ gcc/testsuite/gcc.dg/nextafter-2.c | 3 +++ gcc/testsuite/gcc.dg/profile-info-section.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/gcc/testsuite/gcc.dg/nextafter-1.c b/gcc/testsuite/gcc.dg/nextafter-1.c index 1916ac29ad9..646a741151b 100644 --- a/gcc/testsuite/gcc.dg/nextafter-1.c +++ b/gcc/testsuite/gcc.dg/nextafter-1.c @@ -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 () diff --git a/gcc/testsuite/gcc.dg/nextafter-2.c b/gcc/testsuite/gcc.dg/nextafter-2.c index 8149a709fa5..b36bc8bb7e2 100644 --- a/gcc/testsuite/gcc.dg/nextafter-2.c +++ b/gcc/testsuite/gcc.dg/nextafter-2.c @@ -25,4 +25,7 @@ # define NO_LONG_DOUBLE 1 # endif #endif + +#define _NEXT_AFTER_2 + #include "nextafter-1.c" diff --git a/gcc/testsuite/gcc.dg/profile-info-section.c b/gcc/testsuite/gcc.dg/profile-info-section.c index c27fe17084e..8f31f3b2c07 100644 --- a/gcc/testsuite/gcc.dg/profile-info-section.c +++ b/gcc/testsuite/gcc.dg/profile-info-section.c @@ -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() -- 2.30.2