projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0976d80
)
math: add float-store test
author
nsz
<nsz@port70.net>
Thu, 12 Apr 2012 13:07:21 +0000
(15:07 +0200)
committer
nsz
<nsz@port70.net>
Thu, 12 Apr 2012 13:07:21 +0000
(15:07 +0200)
src/math/sanity.c
patch
|
blob
|
history
diff --git
a/src/math/sanity.c
b/src/math/sanity.c
index
a6661ba
..
9550a70
100644
(file)
--- a/
src/math/sanity.c
+++ b/
src/math/sanity.c
@@
-21,15
+21,21
@@
static int checkl(long double a, long double b)
}
#define D(fx, y) do{ \
}
#define D(fx, y) do{ \
- double yy = fx; \
+ volatile double yy = fx; \
+ volatile long double yl = fx; \
if (!check(yy, y)) \
error("%s got %a = %.21e want %a = %.21e\n", #fx, yy, yy, y, y); \
if (!check(yy, y)) \
error("%s got %a = %.21e want %a = %.21e\n", #fx, yy, yy, y, y); \
+ if (yy != yl) \
+ error("float-store issue: (double)%s = %a (long double)%s = %La\n", #fx, yy, #fx, yl); \
}while(0)
#define F(fx, y) do{ \
}while(0)
#define F(fx, y) do{ \
- float yy = fx; \
+ volatile float yy = fx; \
+ volatile long double yl = fx; \
if (!checkf(yy, y)) \
error("%s got %a = %.21e want %a = %.21e\n", #fx, yy, yy, y, y); \
if (!checkf(yy, y)) \
error("%s got %a = %.21e want %a = %.21e\n", #fx, yy, yy, y, y); \
+ if (yy != yl) \
+ error("float-store issue: (float)%s = %a (long double)%s = %La\n", #fx, yy, #fx, yl); \
}while(0)
#define L(fx, y) do{ \
}while(0)
#define L(fx, y) do{ \