Mercurial > gnulib
annotate tests/test-frexpl.c @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
8498 | 1 /* Test of splitting a 'long double' into fraction and mantissa. |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16559
diff
changeset
|
2 Copyright (C) 2007-2013 Free Software Foundation, Inc. |
8498 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8912
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
8498 | 5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8912
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8912
diff
changeset
|
7 (at your option) any later version. |
8498 | 8 |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8912
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
8498 | 16 |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ | |
18 | |
19 #include <config.h> | |
20 | |
21 #include <math.h> | |
22 | |
12489 | 23 #include "signature.h" |
24 SIGNATURE_CHECK (frexpl, long double, (long double, int *)); | |
25 | |
8498 | 26 #include <float.h> |
27 | |
8531 | 28 #include "fpucw.h" |
8545
418f381347dc
Work around IRIX 6.5 cc compiler bug, which simplifies x != x to false.
Bruno Haible <bruno@clisp.org>
parents:
8531
diff
changeset
|
29 #include "isnanl-nolibm.h" |
13834
108bbfd6f03b
frexp, tests: work around ICC bug with -zero
Eric Blake <eblake@redhat.com>
parents:
12559
diff
changeset
|
30 #include "minus-zero.h" |
15595
328819af1c02
Support for MSVC compiler: Avoid division by a literal 0.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
31 #include "infinity.h" |
11224
5aa57cee93aa
avoid gcc 3.4.3 bug on long double NaN on Irix 6.5
Eric Blake <ebb9@byu.net>
parents:
11002
diff
changeset
|
32 #include "nan.h" |
12496
a48d3d749ca5
Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents:
12489
diff
changeset
|
33 #include "macros.h" |
8531 | 34 |
9860
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9309
diff
changeset
|
35 /* Avoid some warnings from "gcc -Wshadow". |
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9309
diff
changeset
|
36 This file doesn't use the exp() function. */ |
9916
3826b3abb5d0
Fix compilation failure on AIX with xlc.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
37 #undef exp |
9860
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9309
diff
changeset
|
38 #define exp exponent |
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9309
diff
changeset
|
39 |
16557 | 40 #undef INFINITY |
41 #undef NAN | |
42 | |
43 #define DOUBLE long double | |
44 #define VOLATILE | |
45 #define ISNAN isnanl | |
46 #define INFINITY Infinityl () | |
47 #define NAN NaNl () | |
48 #define L_(literal) literal##L | |
49 #define MINUS_ZERO minus_zerol | |
50 #define MAX_EXP LDBL_MAX_EXP | |
51 #define MIN_EXP LDBL_MIN_EXP | |
8548
7794b324d462
Avoid test failures on IRIX MIPS.
Bruno Haible <bruno@clisp.org>
parents:
8545
diff
changeset
|
52 /* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable |
8912
74eb90011cf9
Avoid test failures on some PowerPC hardwares.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
53 exponent for 'long double' is -964. Similarly, on PowerPC machines, |
74eb90011cf9
Avoid test failures on some PowerPC hardwares.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
54 LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' |
74eb90011cf9
Avoid test failures on some PowerPC hardwares.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
55 is -968. For exponents below that, the precision may be truncated to the |
74eb90011cf9
Avoid test failures on some PowerPC hardwares.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
56 precision used for 'double'. */ |
8548
7794b324d462
Avoid test failures on IRIX MIPS.
Bruno Haible <bruno@clisp.org>
parents:
8545
diff
changeset
|
57 #ifdef __sgi |
7794b324d462
Avoid test failures on IRIX MIPS.
Bruno Haible <bruno@clisp.org>
parents:
8545
diff
changeset
|
58 # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57) |
8912
74eb90011cf9
Avoid test failures on some PowerPC hardwares.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
59 #elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__ |
74eb90011cf9
Avoid test failures on some PowerPC hardwares.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
60 # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) |
8548
7794b324d462
Avoid test failures on IRIX MIPS.
Bruno Haible <bruno@clisp.org>
parents:
8545
diff
changeset
|
61 #else |
7794b324d462
Avoid test failures on IRIX MIPS.
Bruno Haible <bruno@clisp.org>
parents:
8545
diff
changeset
|
62 # define MIN_NORMAL_EXP LDBL_MIN_EXP |
7794b324d462
Avoid test failures on IRIX MIPS.
Bruno Haible <bruno@clisp.org>
parents:
8545
diff
changeset
|
63 #endif |
16557 | 64 #define FREXP frexpl |
16559 | 65 #define RANDOM randoml |
16557 | 66 #include "test-frexp.h" |
8498 | 67 |
68 int | |
69 main () | |
70 { | |
8531 | 71 DECL_LONG_DOUBLE_ROUNDING |
72 | |
73 BEGIN_LONG_DOUBLE_ROUNDING (); | |
8498 | 74 |
16557 | 75 test_function (); |
8498 | 76 |
77 return 0; | |
78 } |