URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Subversion Repositories scarts
[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [p755.C] - Rev 12
Compare with Previous | Blame | View Log
// { dg-do run }
// It checks to see if you can define your own global new operator.
// 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;
}
int main () {
int* i = new int;
delete i;
return 1;
}