[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r17008 - in /libdfp/trunk: ChangeLog Makefile.in TODO tests/test-GCC-PR52140.c tests/test-istream.cpp



Author: ryanarn
Date: Mon Feb  6 21:03:07 2012
New Revision: 17008

Log:
Added testcase for ICE.

2012-02-06  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>

	* Makefile.in (libdfp_c_tests): Add test-GCC-PR52140.c.
	* tests/test-istream.cpp: Comment out NaN tests.  Two nans can't be
	compared.
	* tests/test-GCC-PR52140.c: New testcase for ICE.
	* TODO: Add item to upgrade libdecnumber version.


Added:
    libdfp/trunk/tests/test-GCC-PR52140.c
Modified:
    libdfp/trunk/ChangeLog
    libdfp/trunk/Makefile.in
    libdfp/trunk/TODO
    libdfp/trunk/tests/test-istream.cpp

Modified: libdfp/trunk/ChangeLog
==============================================================================
--- libdfp/trunk/ChangeLog (original)
+++ libdfp/trunk/ChangeLog Mon Feb  6 21:03:07 2012
@@ -1,3 +1,11 @@
+2012-02-06  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
+
+	* Makefile.in (libdfp_c_tests): Add test-GCC-PR52140.c.
+	* tests/test-istream.cpp: Comment out NaN tests.  Two nans can't be
+	compared.
+	* tests/test-GCC-PR52140.c: New testcase for ICE.
+	* TODO: Add item to upgrade libdecnumber version.
+
 2012-02-04  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
 
 	* Makefile.in (install-readme): New target.

Modified: libdfp/trunk/Makefile.in
==============================================================================
--- libdfp/trunk/Makefile.in (original)
+++ libdfp/trunk/Makefile.in Mon Feb  6 21:03:07 2012
@@ -335,7 +335,7 @@
 		 test-isnan test-isinf test-isfinite test-fpclassify test-logd \
 		 test-log10d test-strtod test-numdigits test-get_digits \
 		 test-round test-bfp-conversions test-stdlib test-wchar \
-		 test-expd
+		 test-expd test-GCC-PR52140
 
 libdfp_cxx_tests = test-ostream test-ostream-g-spec test-istream
 

Modified: libdfp/trunk/TODO
==============================================================================
--- libdfp/trunk/TODO (original)
+++ libdfp/trunk/TODO Mon Feb  6 21:03:07 2012
@@ -1,3 +1,9 @@
+
+
+Upgrade libdecnumber version.
+  Upgrade autoconf version
+    Add @docdir@ to Makefile (supported in autoconf 2.6.0).
+
 test make install headers with dfp/decimal/ headers.
 
 Add testcase to verify soft-dfp TLS version of rounding mode functions.
@@ -20,10 +26,12 @@
 [DONE] If system glibc is 2.10 then make check shouldn't need all the GLIBC build
 scaffolding for executing and debugging tests.
 
-Clear up make clean and make distclean.
+[DONE] Clear up make clean 
 
-Clear up dependency issue so that libdfp.so.1 is rebuilt when a .c file
-changes.
+Work on make distclean.
+
+[DONE] Clear up dependency issue so that libdfp.so.1 is rebuilt when a .c
+file changes.
 
 Finish make check test suite.
 

Added: libdfp/trunk/tests/test-GCC-PR52140.c
==============================================================================
--- libdfp/trunk/tests/test-GCC-PR52140.c (added)
+++ libdfp/trunk/tests/test-GCC-PR52140.c Mon Feb  6 21:03:07 2012
@@ -1,0 +1,45 @@
+/* Test GCC PR<number> which causes and ICE in soft-dfp.
+
+   Copyright (C) 2012 Free Software Foundation, Inc.
+
+   This file is part of the Decimal Floating Point C Library.
+
+   Author(s): Ryan S. Arnold <rsa@xxxxxxxxxx>
+
+   The Decimal Floating Point C Library is free software; you can
+   redistribute it and/or modify it under the terms of the GNU Lesser
+   General Public License version 2.1.
+
+   The Decimal Floating Point C Library is distributed in the hope that
+   it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+   the GNU Lesser General Public License version 2.1 for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License version 2.1 along with the Decimal Floating Point C Library;
+   if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+   Suite 330, Boston, MA 02111-1307 USA.
+
+   Please see libdfp/COPYING.txt for more information.  */
+
+#ifndef __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__
+#endif
+
+int
+foo (_Decimal64 x, _Decimal64 y)
+{
+  /* This is known to cause a GCC ICE when libdfp is compiled w/o -mcpu and -O1
+     optimization level or greater.
+     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52140  */
+  return (x < y) || (x > y);
+}
+
+int main(void)
+{
+  int ret = -1;
+  _Decimal64 a = 12.45DD;
+  _Decimal64 b = 12.43DD;
+  ret = foo (a,b);
+  return 0;
+}

Modified: libdfp/trunk/tests/test-istream.cpp
==============================================================================
--- libdfp/trunk/tests/test-istream.cpp (original)
+++ libdfp/trunk/tests/test-istream.cpp Mon Feb  6 21:03:07 2012
@@ -37,6 +37,8 @@
 /* For cout support.  */
 #include <iostream>
 
+#include <math.h>
+
 using namespace std;
 using namespace std::decimal;
 
@@ -71,6 +73,7 @@
   decimal64 tmp;
 } d64_type;
 
+
 d64_type istream_d64s[] =
 {
   {__LINE__, -9.999E-3DD, "-0.009999", "%Da", -1.0DD},
@@ -79,10 +82,14 @@
   {__LINE__, -9.999E-3DD, "-0.009999", "%Da", -1.0DD},
   {__LINE__, __builtin_infd64(), "inf", "%Da", -1.0DD},
   {__LINE__, __builtin_infd64(), "INF", "%Da", -1.0DD},
-  {__LINE__, (0.0DD * __builtin_infd64()), "NAN", "%Da", -1.0DD},
-  {__LINE__, (0.0DD * __builtin_infd64()), "nan", "%Da", -1.0DD},
+  /* You can't value compare nan to nan.  */
+  /* {__LINE__, (0.0DD * __builtin_infd64()), "NAN", "%Da", -1.0DD},  */
+  /* You can't value compare nan to nan.  */
+  /* {__LINE__, (0.0DD * __builtin_infd64()), "nan", "%Da", -1.0DD},  */
   {0,0,0,0,0}
 };
+
+
 
 typedef struct{
   int line;

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits