diff options
author | Daniel Richard G <skunk@iSKUNK.ORG> | 2016-08-17 16:55:13 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-08-17 17:44:56 -0700 |
commit | 74e641c2e51562304bebbd69bbe0919be027ccde (patch) | |
tree | bf1cd740b918c33e7a16e8ab53e175947ac78136 /tests | |
parent | 17b66f6152d4e398aa6ef35d644a00fe56bdb67c (diff) | |
download | gnulib-74e641c2e51562304bebbd69bbe0919be027ccde.tar.gz |
maint: preprocessor changes to support z/OS
* lib/alloca.in.h, lib/fnmatch.c, lib/get-rusage-as.c:
* lib/glob.c, lib/math.in.h, lib/ptsname_r.c:
* tests/infinity.h, tests/nan.h, tests/test-canonicalize-lgpl.c:
* tests/test-nonblocking-pipe.h:
Diffstat (limited to 'tests')
-rw-r--r-- | tests/infinity.h | 17 | ||||
-rw-r--r-- | tests/nan.h | 20 | ||||
-rw-r--r-- | tests/test-canonicalize-lgpl.c | 4 | ||||
-rw-r--r-- | tests/test-nonblocking-pipe.h | 3 |
4 files changed, 30 insertions, 14 deletions
diff --git a/tests/infinity.h b/tests/infinity.h index ce23759c4b..9cf8d002d7 100644 --- a/tests/infinity.h +++ b/tests/infinity.h @@ -17,8 +17,9 @@ /* Infinityf () returns a 'float' +Infinity. */ -/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. */ -#if defined _MSC_VER +/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. + The IBM XL C compiler on z/OS complains. */ +#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) static float Infinityf () { @@ -32,8 +33,9 @@ Infinityf () /* Infinityd () returns a 'double' +Infinity. */ -/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */ -#if defined _MSC_VER +/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. + The IBM XL C compiler on z/OS complains. */ +#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) static double Infinityd () { @@ -47,9 +49,10 @@ Infinityd () /* Infinityl () returns a 'long double' +Infinity. */ -/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. */ -#if defined _MSC_VER -static double +/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. + The IBM XL C compiler on z/OS complains. */ +#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) +static long double Infinityl () { static long double zero = 0.0L; diff --git a/tests/nan.h b/tests/nan.h index 2578eb5c69..40045f20d5 100644 --- a/tests/nan.h +++ b/tests/nan.h @@ -15,11 +15,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* IBM z/OS supports both hexadecimal and IEEE floating-point formats. The + former does not support NaN and its isnan() implementation returns zero + for all values. */ +#if defined __MVS__ && defined __IBMC__ && !defined __BFP__ +# error "NaN is not supported with IBM's hexadecimal floating-point format; please re-compile with -qfloat=ieee" +#endif + /* NaNf () returns a 'float' not-a-number. */ /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke - on the expression 0.0 / 0.0. */ -#if defined __DECC || defined _MSC_VER + on the expression 0.0 / 0.0. The IBM XL C compiler on z/OS complains. */ +#if defined __DECC || defined _MSC_VER || (defined __MVS__ && defined __IBMC__) static float NaNf () { @@ -34,8 +41,8 @@ NaNf () /* NaNd () returns a 'double' not-a-number. */ /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke - on the expression 0.0 / 0.0. */ -#if defined __DECC || defined _MSC_VER + on the expression 0.0 / 0.0. The IBM XL C compiler on z/OS complains. */ +#if defined __DECC || defined _MSC_VER || (defined __MVS__ && defined __IBMC__) static double NaNd () { @@ -51,14 +58,15 @@ NaNd () /* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the runtime type conversion. - The Microsoft MSVC 9 compiler chokes on the expression 0.0L / 0.0L. */ + The Microsoft MSVC 9 compiler chokes on the expression 0.0L / 0.0L. + The IBM XL C compiler on z/OS complains. */ #ifdef __sgi static long double NaNl () { double zero = 0.0; return zero / zero; } -#elif defined _MSC_VER +#elif defined _MSC_VER || (defined __MVS__ && defined __IBMC__) static long double NaNl () { diff --git a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c index e5f0adb458..d1c71e6a14 100644 --- a/tests/test-canonicalize-lgpl.c +++ b/tests/test-canonicalize-lgpl.c @@ -191,12 +191,16 @@ main (void) ASSERT (result2); ASSERT (stat ("/", &st1) == 0); ASSERT (stat ("//", &st2) == 0); + /* On IBM z/OS, "/" and "//" are distinct, yet they both have + st_dev == st_ino == 1. */ +#ifndef __MVS__ if (SAME_INODE (st1, st2)) { ASSERT (strcmp (result1, "/") == 0); ASSERT (strcmp (result2, "/") == 0); } else +#endif { ASSERT (strcmp (result1, "//") == 0); ASSERT (strcmp (result2, "//") == 0); diff --git a/tests/test-nonblocking-pipe.h b/tests/test-nonblocking-pipe.h index 6adb3533d0..9141c60afd 100644 --- a/tests/test-nonblocking-pipe.h +++ b/tests/test-nonblocking-pipe.h @@ -31,10 +31,11 @@ OSF/1 >= 262145 Solaris <= 7 >= 10241 Solaris >= 8 >= 20481 + z/OS >= 131073 Cygwin >= 65537 native Windows >= 4097 (depends on the _pipe argument) */ -#if defined __osf__ || (defined __linux__ && (defined __ia64__ || defined __mips__)) +#if defined __MVS__ || defined __osf__ || (defined __linux__ && (defined __ia64__ || defined __mips__)) # define PIPE_DATA_BLOCK_SIZE 270000 #elif defined __linux__ && defined __sparc__ # define PIPE_DATA_BLOCK_SIZE 140000 |