Commit ffb28279 by Mark Mitchell Committed by Mark Mitchell

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
parent 8d48367b
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.
......
......@@ -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;
}
......
// 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 () {
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment