projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d909273
)
Fix test to work on IRIX 6.5 with cc.
author
Bruno Haible
<bruno@clisp.org>
Wed, 2 Apr 2008 01:29:50 +0000
(
03:29
+0200)
committer
Bruno Haible
<bruno@clisp.org>
Wed, 2 Apr 2008 01:29:50 +0000
(
03:29
+0200)
ChangeLog
patch
|
blob
|
history
tests/test-math.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 1f84a20e9ecbd3edd35d75b12ac74a79b1904f78..9232d1d51615fd6149f233b8b14d35b3d85ff29f 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,9
@@
+2008-04-01 Bruno Haible <bruno@clisp.org>
+
+ Fix test to work on IRIX 6.5 with cc.
+ * tests/test-math.c (numeric_equal): New function.
+ (main): Use it.
+
2008-04-01 Bruno Haible <bruno@clisp.org>
* doc/posix-headers/math.texi: Refine documentation of NAN problem.
2008-04-01 Bruno Haible <bruno@clisp.org>
* doc/posix-headers/math.texi: Refine documentation of NAN problem.
diff --git
a/tests/test-math.c
b/tests/test-math.c
index 56cf058c48e75f3ab7101b883dfcc4915f08381a..ec654b26010fcc497553b96fc71218d3356020eb 100644
(file)
--- a/
tests/test-math.c
+++ b/
tests/test-math.c
@@
-30,9
+30,20
@@
choke me
static float n = NAN;
#endif
static float n = NAN;
#endif
+/* Compare two numbers with ==.
+ This is a separate function because IRIX 6.5 "cc -O" miscompiles an
+ 'x == x' test. */
+static int
+numeric_equal (double x, double y)
+{
+ return x == y;
+}
+
int
main ()
{
double d = NAN;
int
main ()
{
double d = NAN;
- return d == d;
+ if (numeric_equal (d, d))
+ return 1;
+ return 0;
}
}