p755.C: Tweak handling of exit.

* 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.

From-SVN: r37257
This commit is contained in:
Mark Mitchell 2000-11-04 20:00:52 +00:00 committed by Mark Mitchell
parent 8d48367bef
commit ffb2827932
4 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,10 @@
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.
2000-11-04 Neil Booth <neilb@earthling.net>
* gcc.dg/cpp/include2.c: New tests.

View File

@ -2,11 +2,12 @@
// prms-id: 755
#include <new>
extern "C" void exit(int);
extern "C" void _exit(int);
void* operator new(size_t sz) throw (std::bad_alloc) {
void* p = 0;
exit(0);
_exit(0);
return p;
}

View File

@ -1,10 +1,10 @@
// It checks to see if you can define your own global delete operator.
// prms-id: 755
extern "C" void exit(int);
extern "C" void _exit(int);
void operator delete(void *p) throw() {
exit(0);
_exit(0);
}
int main () {

View File

@ -19,6 +19,10 @@ public:
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();