This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.15-67-g1d5a644
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 8 Jan 2012 21:03:00 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.15-67-g1d5a644
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 1d5a644a55c60ad1f1903e851255ec9b2f45879b (commit)
from 8784a6db9151da74c1ffab427d49014533cf865f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1d5a644a55c60ad1f1903e851255ec9b2f45879b
commit 1d5a644a55c60ad1f1903e851255ec9b2f45879b
Author: Ulrich Drepper <drepper@gmail.com>
Date: Sun Jan 8 16:02:45 2012 -0500
Add test for CMPLX macros
diff --git a/ChangeLog b/ChangeLog
index 8c48331..bec9b38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-01-08 Ulrich Drepper <drepper@gmail.com>
+ * math/Makefile (tests): Add tst-CMPLX.
+ * math/test-CMPLX.c: New file.
+
* math/complex.h (CMPLXL): Fix typo.
* debug/Makefile (routines): Add poll_chk and ppoll_chk.
diff --git a/math/Makefile b/math/Makefile
index 2819550..7ccbc11 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -91,7 +91,7 @@ distribute += $(filter-out $(generated),$(long-m-yes:=.c) $(long-c-yes:=.c))
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
- test-tgmath2 test-powl
+ test-tgmath2 test-powl tst-CMPLX
# We do the `long double' tests only if this data type is available and
# distinct from `double'.
test-longdouble-yes = test-ldouble test-ildoubl
diff --git a/math/tst-CMPLX.c b/math/tst-CMPLX.c
new file mode 100644
index 0000000..2c32438
--- /dev/null
+++ b/math/tst-CMPLX.c
@@ -0,0 +1,56 @@
+#include <complex.h>
+
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+#ifdef CMPLX
+ size_t s;
+
+#define T(f, r, i, t) \
+ do { \
+ s = sizeof (f (r, i)); \
+ if (s != sizeof (complex t)) \
+ { \
+ printf ("\
+CMPLX (" #r ", " #i ") does not produce complex " #t ": %zu\n", s); \
+ result = 1; \
+ } \
+ } while (0)
+
+#define C(f, t) \
+ do { \
+ T (f, 0.0f, 0.0f, t); \
+ T (f, 0.0f, 0.0, t); \
+ T (f, 0.0f, 0.0L, t); \
+ T (f, 0.0f, 0.0f, t); \
+ T (f, 0.0, 0.0f, t); \
+ T (f, 0.0L, 0.0f, t); \
+ T (f, 0.0, 0.0f, t); \
+ T (f, 0.0, 0.0, t); \
+ T (f, 0.0, 0.0L, t); \
+ T (f, 0.0f, 0.0, t); \
+ T (f, 0.0, 0.0, t); \
+ T (f, 0.0L, 0.0, t); \
+ T (f, 0.0L, 0.0f, t); \
+ T (f, 0.0L, 0.0, t); \
+ T (f, 0.0L, 0.0L, t); \
+ T (f, 0.0f, 0.0L, t); \
+ T (f, 0.0, 0.0L, t); \
+ T (f, 0.0L, 0.0L, t); \
+ } while (0)
+
+ C (CMPLXF, float);
+ C (CMPLX, double);
+# ifndef NO_LONG_DOUBLE
+ C (CMPLXL, long double);
+# endif
+#endif
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 3 ++
math/Makefile | 2 +-
math/tst-CMPLX.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 60 insertions(+), 1 deletions(-)
create mode 100644 math/tst-CMPLX.c
hooks/post-receive
--
GNU C Library master sources