about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-14 12:15:40 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-03-14 12:54:47 -0500
commit4655c291d1808c35b7c54236ae62be7a3aaa0a2d (patch)
tree6ee5a01b888c48e642cbad3961caf01c4dee9a6c
parentd7329d4b4d297b5638aef7fc4d5eaf9ad7845d7a (diff)
downloadglibc-4655c291d1808c35b7c54236ae62be7a3aaa0a2d.tar.gz
glibc-4655c291d1808c35b7c54236ae62be7a3aaa0a2d.tar.xz
glibc-4655c291d1808c35b7c54236ae62be7a3aaa0a2d.zip
Add truncl tests related to BZ#16414
-rw-r--r--ChangeLog5
-rw-r--r--math/libm-test.inc9
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ae102928a6..59f3bb3bf3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-14  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* math/libm-test.inc (trunc_test_data): Add more tests related to
+	BZ#16414.
+
 2014-03-14  Roland McGrath  <roland@hack.frob.com>
 
 	* nptl/pthread_create.c (__pthread_create_2_1): Test TLS_TCB_AT_TP
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 574654e222..10e7806846 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -11283,6 +11283,15 @@ static const struct test_f_f_data trunc_test_data[] =
     TEST_f_f (trunc, -72057594037927936.75L, -72057594037927936.0L),
     TEST_f_f (trunc, -72057594037927937.5L, -72057594037927937.0L),
 
+    /* Check cases where first double is a exact integer higher than 2^52 and
+       the precision is determined by second long double for IBM long double.  */
+    TEST_f_f (trunc,  34503599627370498.515625L, 34503599627370498.0L),
+    TEST_f_f (trunc, -34503599627370498.515625L, -34503599627370498.0L),
+# if LDBL_MANT_DIG >= 106
+    TEST_f_f (trunc,  1192568192774434123539907640624.484375L, 1192568192774434123539907640624.0L),
+    TEST_f_f (trunc, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L),
+# endif
+
     TEST_f_f (trunc, 10141204801825835211973625643007.5L, 10141204801825835211973625643007.0L),
     TEST_f_f (trunc, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L),
     TEST_f_f (trunc, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L),