C++ PATCH: Fixes to testsuite to work with V3

Mark Mitchell mark@codesourcery.com
Thu Oct 26 16:18:00 GMT 2000


This patch consists of a lot of little tweaks to the G++ testsuite to
make it work with both V2 and V3.

Also, I added a `include/backward/streambuf.h' file for V3; that's
required by one of the tests in the testsuite.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-10-25  Mark Mitchell  <mark@codesourcery.com>

	* Makefile.in (site.exp): Define HAVE_LIBSTDCXX_V3.
	* configure.in (enable-libstdcxx-v3): Arrange to have
	HAVE_LIBSTDCXX_V3 substituted into the output files.

2000-10-26  Mark Mitchell  <mark@codesourcery.com>

	* g++.old-deja/g++.brendan/label2.C: Tweak to work with V3.
	* g++.old-deja/g++.law/builtin1.C: Likewise.
	* g++.old-deja/g++.law/ctors10.C: Likewise.
	* g++.old-deja/g++.law/virtual3.C: Likewise.
	* g++.old-deja/g++.mike/p658.C: Likewise.
	* g++.old-deja/g++.other/sibcall1.C: Likewise.
	* g++.old-deja/g++.other/vaarg2.C: Likewise.
	* g++.old-deja/g++.robertl/eb124.C: Likewise.
	* g++.old-deja/g++.robertl/eb44.C: Likewise.
	* g++.old-deja/g++.robertl/eb77.C: Likewise.

Index: gcc/testsuite/g++.old-deja/g++.brendan/label2.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.brendan/label2.C,v
retrieving revision 1.2
diff -c -p -r1.2 label2.C
*** label2.C	1998/12/16 21:25:34	1.2
--- label2.C	2000/10/26 23:10:57
***************
*** 1,5 ****
--- 1,8 ----
  // Build don't link: 
  // GROUPS passed labels
+ 
+ extern "C" void abort();
+ 
  class X {
  public:
      X();
Index: gcc/testsuite/g++.old-deja/g++.law/builtin1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/builtin1.C,v
retrieving revision 1.2
diff -c -p -r1.2 builtin1.C
*** builtin1.C	1998/12/16 21:39:23	1.2
--- builtin1.C	2000/10/26 23:10:57
*************** extern "C" void* alloca( __SIZE_TYPE__ )
*** 12,17 ****
  extern "C" int printf (const char *, ...);
  
  void* junk() {
!   return alloca(10);
  }
  main() { printf ("PASS\n");}
--- 12,17 ----
  extern "C" int printf (const char *, ...);
  
  void* junk() {
!   return std::alloca(10);
  }
  main() { printf ("PASS\n");}
Index: gcc/testsuite/g++.old-deja/g++.law/ctors10.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/ctors10.C,v
retrieving revision 1.2
diff -c -p -r1.2 ctors10.C
*** ctors10.C	1998/12/16 21:39:34	1.2
--- ctors10.C	2000/10/26 23:10:57
*************** class Class
*** 13,19 ****
          class Err : public ostream
          {
          public:
!                 Err(void) : ostream() { }
                  ~Err(void) { }
          };
  public:
--- 13,19 ----
          class Err : public ostream
          {
          public:
!                 Err(void) : ostream(NULL) { }
                  ~Err(void) { }
          };
  public:
Index: gcc/testsuite/g++.old-deja/g++.law/virtual3.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.law/virtual3.C,v
retrieving revision 1.3
diff -c -p -r1.3 virtual3.C
*** virtual3.C	1998/12/16 21:42:44	1.3
--- virtual3.C	2000/10/26 23:10:58
*************** BugStream& BugStream::eval()
*** 29,35 ****
     cerr << s << endl;
     
     // reset the stream for the next command    
!    clear(0);
     rdbuf()->freeze(0);
     seekp(0);
     
--- 29,35 ----
     cerr << s << endl;
     
     // reset the stream for the next command    
!    clear(ios::goodbit);
     rdbuf()->freeze(0);
     seekp(0);
     
Index: gcc/testsuite/g++.old-deja/g++.mike/p658.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/p658.C,v
retrieving revision 1.4
diff -c -p -r1.4 p658.C
*** p658.C	1998/12/16 21:47:57	1.4
--- p658.C	2000/10/26 23:10:58
***************
*** 1,8 ****
  // prms-id: 658
  
  #include <ostream.h>
! 
! extern "C" void abort();
  
  /* We may not find the libg++ <bool.h>.  */
  #ifndef FALSE
--- 1,7 ----
  // prms-id: 658
  
  #include <ostream.h>
! #include <stdlib.h>
  
  /* We may not find the libg++ <bool.h>.  */
  #ifndef FALSE
Index: gcc/testsuite/g++.old-deja/g++.other/sibcall1.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C,v
retrieving revision 1.1
diff -c -p -r1.1 sibcall1.C
*** sibcall1.C	2000/10/24 11:25:50	1.1
--- sibcall1.C	2000/10/26 23:10:58
***************
*** 1,6 ****
  // Special g++ Options: -O2
  
! #include <iostream>
  
  ostream& foo (char *x, ostream &y)
  {
--- 1,6 ----
  // Special g++ Options: -O2
  
! #include <iostream.h>
  
  ostream& foo (char *x, ostream &y)
  {
Index: gcc/testsuite/g++.old-deja/g++.other/vaarg2.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.other/vaarg2.C,v
retrieving revision 1.1
diff -c -p -r1.1 vaarg2.C
*** vaarg2.C	1999/10/13 08:57:25	1.1
--- vaarg2.C	2000/10/26 23:10:58
***************
*** 1,10 ****
! // Copyright (C) 1999 Free Software Foundation, Inc.
  // Contributed by Nathan Sidwell 4 Oct 1999 <nathan@acm.org>
  
  // Make sure we can deal with POD aggregate in va_args
  
  #include <stdarg.h>
! extern void abort ();
  
  struct X {int m;};
  struct Y {int a; int b; int c; int d; int e; int f;};
--- 1,10 ----
! // Copyright (C) 1999, 2000 Free Software Foundation, Inc.
  // Contributed by Nathan Sidwell 4 Oct 1999 <nathan@acm.org>
  
  // Make sure we can deal with POD aggregate in va_args
  
  #include <stdarg.h>
! extern "C" void abort ();
  
  struct X {int m;};
  struct Y {int a; int b; int c; int d; int e; int f;};
Index: gcc/testsuite/g++.old-deja/g++.robertl/eb124.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb124.C,v
retrieving revision 1.3
diff -c -p -r1.3 eb124.C
*** eb124.C	1998/12/16 22:03:16	1.3
--- eb124.C	2000/10/26 23:10:58
***************
*** 1,3 ****
  //Build don't link:
  #include <stdexcept>
! class X : public std::runtime_error {};
--- 1,5 ----
  //Build don't link:
  #include <stdexcept>
! class X : public std::runtime_error {
!   X ();
! };
Index: gcc/testsuite/g++.old-deja/g++.robertl/eb44.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C,v
retrieving revision 1.5
diff -c -p -r1.5 eb44.C
*** eb44.C	2000/05/28 05:38:02	1.5
--- eb44.C	2000/10/26 23:10:58
*************** ostream& operator<< (ostream& out, const
*** 31,36 ****
  int main()
  {
    Vector<char> vc;
!   ostream out;
!   out << vc;
  }
--- 31,35 ----
  int main()
  {
    Vector<char> vc;
!   cout << vc;
  }
Index: gcc/testsuite/g++.old-deja/g++.robertl/eb77.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C,v
retrieving revision 1.2
diff -c -p -r1.2 eb77.C
*** eb77.C	1998/12/16 22:04:36	1.2
--- eb77.C	2000/10/26 23:10:59
*************** main(int, char* [])
*** 12,19 ****
    int nLine = 0;
  
    while( true ) {
!     char* line = 0;
!     s.gets(&line);
  
      if( ! line ) {
        break;
--- 12,19 ----
    int nLine = 0;
  
    while( true ) {
!     char line[100];
!     s.get(line, 100);
  
      if( ! line ) {
        break;
Index: libstdc++-v3/include/backward/streambuf.h
===================================================================
RCS file: streambuf.h
diff -N streambuf.h
*** /dev/null	Tue May  5 13:32:27 1998
--- streambuf.h	Thu Oct 26 16:11:01 2000
***************
*** 0 ****
--- 1,42 ----
+ 
+ // Copyright (C) 2000 Free Software Foundation, Inc.
+ //
+ // This file is part of the GNU ISO C++ Library.  This library is free
+ // software; you can redistribute it and/or modify it under the
+ // terms of the GNU General Public License as published by the
+ // Free Software Foundation; either version 2, or (at your option)
+ // any later version.
+ 
+ // This 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 General Public License for more details.
+ 
+ // You should have received a copy of the GNU General Public License along
+ // with this library; see the file COPYING.  If not, write to the Free
+ // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ // USA.
+ 
+ // As a special exception, you may use this file as part of a free software
+ // library without restriction.  Specifically, if other files instantiate
+ // templates or use macros or inline functions from this file, or you compile
+ // this file and link it with other files to produce an executable, this
+ // file does not by itself cause the resulting executable to be covered by
+ // the GNU General Public License.  This exception does not however
+ // invalidate any other reasons why the executable file might be covered by
+ // the GNU General Public License.
+ 
+ #ifndef _CPP_BACKWARD_STREAMBUF_H
+ #define _CPP_BACKWARD_STREAMBUF_H 1
+ 
+ #include <bits/std_streambuf.h>
+ 
+ #ifdef __STL_USE_NAMESPACES
+ using __STD::streambuf;
+ #endif /* __STL_USE_NAMESPACES */
+ 
+ #endif /* _CPP_BACKWARD_STREAMBUF_H */
+ 
+ // Local Variables:
+ // mode:C++
+ // End:


More information about the Gcc-patches mailing list