X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-signbit.c;h=97f68e6a71b2d323478b07d6328d52066e6e6aca;hb=7da6c6f9a62e4a00ad88beb04f492b28fe517699;hp=d6efe08b09c9b0e2a2283c14a410f7dea8432cbc;hpb=9d5d03ff00b8b11b51450ce107159b263efb1739;p=gnulib.git diff --git a/tests/test-signbit.c b/tests/test-signbit.c index d6efe08b0..97f68e6a7 100644 --- a/tests/test-signbit.c +++ b/tests/test-signbit.c @@ -1,5 +1,5 @@ /* Test of signbit() substitute. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,10 +49,16 @@ long double zerol = 0.0L; /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. So we use minus_zerol instead. + IRIX cc can't put -0.0L into .data, but can compute at runtime. Note that the expression -LDBL_MIN * LDBL_MIN does not work on other platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */ #if defined __hpux || defined __sgi -long double minus_zerol = -LDBL_MIN * LDBL_MIN; +static long double +compute_minus_zerol (void) +{ + return -LDBL_MIN * LDBL_MIN; +} +# define minus_zerol compute_minus_zerol () #else long double minus_zerol = -0.0L; #endif