From 29ba7c757ae6f9c4859359f427e32e875c32ec0d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 2 Jun 2024 19:31:46 +0200 Subject: [PATCH] totalorder*: Avoid compilation error by IBM XL C compiler. * tests/test-totalorder.h (main) [__IBMC__]: Skip the test. * tests/test-totalordermag.h (main) [__IBMC__]: Likewise. --- ChangeLog | 6 ++++++ tests/test-totalorder.h | 36 +++++++++++++++++++++++++++--------- tests/test-totalordermag.h | 36 +++++++++++++++++++++++++++--------- 3 files changed, 60 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0e33548ce..d3c656a0d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-06-02 Bruno Haible + + totalorder*: Avoid compilation error by IBM XL C compiler. + * tests/test-totalorder.h (main) [__IBMC__]: Skip the test. + * tests/test-totalordermag.h (main) [__IBMC__]: Likewise. + 2024-06-02 Bruno Haible isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc. diff --git a/tests/test-totalorder.h b/tests/test-totalorder.h index fd437160bf..ef8c6b121d 100644 --- a/tests/test-totalorder.h +++ b/tests/test-totalorder.h @@ -16,12 +16,28 @@ #include +/* Specification. */ #include -#include "infinity.h" -#include "macros.h" -#include "minus-zero.h" -#include "signed-nan.h" -#include "signed-snan.h" + +#if defined __IBMC__ +/* The IBM XL C compiler cannot compile the initializer of x[] below. */ + +# include + +int +main () +{ + fputs ("Skipping test: broken C compiler\n", stderr); + return 77; +} + +#else + +# include "infinity.h" +# include "macros.h" +# include "minus-zero.h" +# include "signed-nan.h" +# include "signed-snan.h" static TOTALORDER_TYPE positive_NaN_with_payload (int payload) @@ -47,9 +63,9 @@ main () { negative_NaN_with_payload (1729), negative_NaN_with_payload (641), -#if TOTALORDER_HAVE_SNAN +# if TOTALORDER_HAVE_SNAN TOTALORDER_NEGATIVE_SNAN (), -#endif +# endif { -TOTALORDER_INF () }, { -1e37 }, { -1 }, @@ -60,9 +76,9 @@ main () { 1 }, { 1e37 }, { TOTALORDER_INF () }, -#if TOTALORDER_HAVE_SNAN +# if TOTALORDER_HAVE_SNAN TOTALORDER_POSITIVE_SNAN (), -#endif +# endif positive_NaN_with_payload (641), positive_NaN_with_payload (1729) }; @@ -78,3 +94,5 @@ main () return test_exit_status; } + +#endif diff --git a/tests/test-totalordermag.h b/tests/test-totalordermag.h index 11990cda3d..94f929f39e 100644 --- a/tests/test-totalordermag.h +++ b/tests/test-totalordermag.h @@ -16,12 +16,28 @@ #include +/* Specification. */ #include -#include "infinity.h" -#include "macros.h" -#include "minus-zero.h" -#include "signed-nan.h" -#include "signed-snan.h" + +#if defined __IBMC__ +/* The IBM XL C compiler cannot compile the initializer of x[] below. */ + +# include + +int +main () +{ + fputs ("Skipping test: broken C compiler\n", stderr); + return 77; +} + +#else + +# include "infinity.h" +# include "macros.h" +# include "minus-zero.h" +# include "signed-nan.h" +# include "signed-snan.h" static TOTALORDER_TYPE positive_NaN_with_payload (int payload) @@ -47,9 +63,9 @@ main () { negative_NaN_with_payload (1729), negative_NaN_with_payload (641), -#if TOTALORDER_HAVE_SNAN +# if TOTALORDER_HAVE_SNAN TOTALORDER_NEGATIVE_SNAN (), -#endif +# endif { -TOTALORDER_INF () }, { -1e37 }, { -1 }, @@ -60,9 +76,9 @@ main () { 1 }, { 1e37 }, { TOTALORDER_INF () }, -#if TOTALORDER_HAVE_SNAN +# if TOTALORDER_HAVE_SNAN TOTALORDER_POSITIVE_SNAN (), -#endif +# endif positive_NaN_with_payload (641), positive_NaN_with_payload (1729) }; @@ -79,3 +95,5 @@ main () return test_exit_status; } + +#endif -- 2.39.5