add testcase from
http://sourceware.org/bugzilla/show_bug.cgi?id=4407
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return x*x;
- if((ix|lx)==0) return one/zero;
+ if((ix|lx)==0) {
+ if (__signbitl(x))
+ *signgamp = -1;
+ return one/zero;
+ }
if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
math/libm-test-ulps.h
math/libm-test.c
math/rint
+math/signgam
math/test-double
math/test-ildoubl
math/test-ldouble
# uClibc math tests
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble
+TESTS := basic-test rint signgam tst-definitions test-fpucw test-float test-ifloat test-double test-idouble
ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
TESTS += test-ldouble test-ildoubl compile_test
else
endif
DODIFF_rint := 1
+DODIFF_signgam := 1
# NOTE: For basic-test we must disable the floating point optimization.
# Only for sh architecture because in the other architecture are disabled.
--- /dev/null
+#define _XOPEN_SOURCE 600
+#include <math.h>
+#include <stdio.h>
+
+double zero = 0.0;
+double mzero;
+
+int
+main (void)
+{
+ double d;
+ mzero = copysign (zero, -1.0);
+ d = lgamma (zero);
+ printf ("%g %d\n", d, signgam);
+ d = lgamma (mzero);
+ printf ("%g %d\n", d, signgam);
+ return 0;
+}