This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 27_io/istream_extractor_arith.cc fixup


Benjamin Kosnik wrote:

> Hey can this patch:
>
> 2002-01-28  Paolo Carlini  <pcarlini@unitus.it>
>
>         * testsuite/27_io/ostream_inserter_arith.cc (test03):
>         Fix to deal correctly with both 32 bit and 64 bit architectures
>
> Be extended to
>
>  27_io/istream_extractor_arith.cc fixup
>
> To fix the fail shown here:
>
> http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00576.html
> http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00582.html
> http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00509.html
>
> ?

I will see, by the way, I have ready (tested i686-pc-linux-gnu, at least) an
improvement of the original patch for ostream_inserter_arith.cc, suggested by
Richard Henderson, attached below (it gets rid the test of the implicit
assumption that CHAR_BIT == 8).

What *really* puzzles me is this:

    http://gcc.gnu.org/ml/gcc-testresults/2002-01/msg00582.html

How possibly, ostream_inserter_arith.cc can fail now on ia64? It did'nt fail
before enabling test03, then Andreas tested positively the patch above, and then
it fails now?!?

Andreas, could you please provide some details from libstdc++-v3.log ???

Cheers,
Paolo.

/////////////

diff -urN libstdc++-v3-orig/testsuite/27_io/ostream_inserter_arith.cc
libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
--- libstdc++-v3-orig/testsuite/27_io/ostream_inserter_arith.cc Mon Jan 28
20:04:34 2002
+++ libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc Tue Jan 29 13:17:35
2002
@@ -312,26 +312,26 @@
   ostream o(&strbuf);

   o << oct << s << ' ' << hex << s;
-  if (sizeof(short) == 2)
+  if (numeric_limits<short>::digits + 1 == 16)
     VERIFY( strbuf.str() == "177777 ffff" );
-  else // sizeof(short) == 4
+  else
     VERIFY( strbuf.str() == "37777777777 ffffffff" );
   strbuf.str(str_blank);

   o << oct << i << ' ' << hex << i;
-  if (sizeof(int) == 2)
+  if (numeric_limits<int>::digits + 1 == 16)
     VERIFY( strbuf.str() == "177777 ffff" );
-  else if (sizeof(int) == 4)
+  else if (numeric_limits<int>::digits + 1 == 32)
     VERIFY( strbuf.str() == "37777777777 ffffffff" );
-  else // sizeof(int) == 8
+  else
     VERIFY( strbuf.str() == "1777777777777777777777 "
      "ffffffffffffffff" );
   strbuf.str(str_blank);

   o << oct << l << ' ' << hex << l;
-  if (sizeof(long) == 4)
+  if (numeric_limits<long>::digits + 1 == 32)
     VERIFY( strbuf.str() == "37777777777 ffffffff" );
-  else // sizeof(long) == 8
+  else
     VERIFY( strbuf.str() == "1777777777777777777777 "
      "ffffffffffffffff" );
   strbuf.str(str_blank);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]