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:
parent
8d48367bef
commit
ffb2827932
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 () {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user