PATCH: More V3 testsuite changes
Mark Mitchell
mark@codesourcery.com
Sat Nov 4 12:04:00 GMT 2000
The V3 shared library makes calls to `operator new' during startup.
That means that several tests that didn't expect this need tweaking.
Also, the library expects to call `delete' on exit, so tests that
broke new/delete intentionally need to avoid those calls happenning.
I accomplished this by calling `_exit' rather than `exit'. Are there
systems that do not have `_exit'?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
2000-11-04 Mark Mitchell <mark@codesourcery.com>
* g++.old-deja/g++.mike/p755.C: Tweak handling of exit.
* g++.old-deja/g++.mike/p755a.C: Likewise.
* g++.old-deja/g++.mike/p9706.C: Don't assume that the standard
library makes no calls to `operator new' during initialization.
Index: g++.old-deja/g++.mike/p755.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/p755.C,v
retrieving revision 1.4
diff -c -p -r1.4 p755.C
*** p755.C 1998/12/16 21:48:11 1.4
--- p755.C 2000/11/04 19:55:44
***************
*** 2,12 ****
// prms-id: 755
#include <new>
- extern "C" void exit(int);
void* operator new(size_t sz) throw (std::bad_alloc) {
void* p = 0;
! exit(0);
return p;
}
--- 2,13 ----
// prms-id: 755
#include <new>
+ extern "C" void _exit(int);
+
void* operator new(size_t sz) throw (std::bad_alloc) {
void* p = 0;
! _exit(0);
return p;
}
Index: g++.old-deja/g++.mike/p755a.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/p755a.C,v
retrieving revision 1.3
diff -c -p -r1.3 p755a.C
*** p755a.C 1998/12/16 21:48:12 1.3
--- p755a.C 2000/11/04 19:55:44
***************
*** 1,10 ****
// It checks to see if you can define your own global delete operator.
// prms-id: 755
! extern "C" void exit(int);
void operator delete(void *p) throw() {
! exit(0);
}
int main () {
--- 1,10 ----
// It checks to see if you can define your own global delete operator.
// prms-id: 755
! extern "C" void _exit(int);
void operator delete(void *p) throw() {
! _exit(0);
}
int main () {
Index: g++.old-deja/g++.mike/p9706.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.mike/p9706.C,v
retrieving revision 1.2
diff -c -p -r1.2 p9706.C
*** p9706.C 1998/12/16 21:48:50 1.2
--- p9706.C 2000/11/04 19:55:44
*************** public:
*** 19,24 ****
--- 19,28 ----
int main() {
int i;
+ // The standard library may have called new and/or delete during
+ // startup, so we have to reset the counter here.
+ count = 0;
+
for( i = 0; i < 10; i++ ) {
try {
throw A();
More information about the Gcc-patches
mailing list