This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed, testsuite: tweak g++.old-deja/g++.pt/static11.C, addg++.dg/other/static11.C
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 31 Mar 2002 10:54:46 -0500 (EST)
- Subject: Committed, testsuite: tweak g++.old-deja/g++.pt/static11.C, addg++.dg/other/static11.C
As mentioned in
<URL:http://gcc.gnu.org/ml/gcc-patches/2002-03/msg01985.html>
except just compile it and skip it due to the problem mentioned
in the patch and in
<URL:http://gcc.gnu.org/ml/gcc-patches/2002-03/msg02093.html>.
I verified "manually" that _exit is acually called with 0. Will
commit the g++.old-deja/g++.pt/static11.C part to 3.1 too.
* g++.old-deja/g++.pt/static11.C: Skip on mmix-knuth-mmixware.
* g++.dg/other/static11.C: Copy g++.old-deja/g++.pt/static11.C for
-da test.
Index: static11.C
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.old-deja/g++.pt/static11.C,v
retrieving revision 1.1
diff -p -c -r1.1 static11.C
*** static11.C 2000/09/21 22:05:48 1.1
--- static11.C 2002/03/31 15:28:37
***************
*** 1,5 ****
--- 1,11 ----
// Bug: g++ was failing to destroy C<int>::a because it was using two
// different sentry variables for construction and destruction.
+ //
+ // Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
+ // in their dejagnu baseboard description) require that the status is
+ // final when exit is entered (or main returns), and not "overruled" by a
+ // destructor calling _exit. It's not really worth it to handle that.
+ // Skip if target: mmix-knuth-mmixware
extern "C" void _exit (int);
*** /dev/null Tue Jan 1 05:00:00 1980
--- g++.dg/other/static11.C Sat Mar 30 08:23:31 2002
***************
*** 0 ****
--- 1,32 ----
+ // This is a copy of g++.old-deja/g++.pt/static11.C which at one
+ // time got a SEGV for mmix-knuth-mmixware when compiled with
+ // -da (or either -dj or -df).
+ // { dg-do compile }
+ // { dg-options "-da" }
+
+ extern "C" void _exit (int);
+
+ int r = 1;
+
+ struct A
+ {
+ void f(){};
+ A(){ ++r; }
+ ~A(){ r -= 2; _exit (r); }
+ };
+
+ template<class T>
+ struct C
+ {
+ C(){ a.f(); }
+ static A a;
+ };
+
+ template <class T> A C<T>::a;
+ typedef C<int> B;
+
+ int main()
+ {
+ C<int> c;
+ return r;
+ }
brgds, H-P