URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-fcheck-new -pedantic" }
|
// { dg-options "-fcheck-new -pedantic" }
|
// PRMS Id: 6037
|
// PRMS Id: 6037
|
|
|
extern "C" void * malloc (__SIZE_TYPE__);
|
extern "C" void * malloc (__SIZE_TYPE__);
|
|
|
int ena = 0;
|
int ena = 0;
|
|
|
struct A {
|
struct A {
|
int i;
|
int i;
|
A () { i = 2; }
|
A () { i = 2; }
|
void * operator new (__SIZE_TYPE__ s)
|
void * operator new (__SIZE_TYPE__ s)
|
{
|
{
|
if (ena)
|
if (ena)
|
return 0;
|
return 0;
|
return malloc (s);
|
return malloc (s);
|
}
|
}
|
};
|
};
|
|
|
struct B {
|
struct B {
|
int i;
|
int i;
|
B () { i = 2; }
|
B () { i = 2; }
|
void * operator new (__SIZE_TYPE__ s) throw()
|
void * operator new (__SIZE_TYPE__ s) throw()
|
{
|
{
|
if (ena)
|
if (ena)
|
return 0;
|
return 0;
|
return malloc (s);
|
return malloc (s);
|
}
|
}
|
};
|
};
|
|
|
int main ()
|
int main ()
|
{
|
{
|
ena = 1;
|
ena = 1;
|
A *ap = new A;
|
A *ap = new A;
|
B *bp = new B;
|
B *bp = new B;
|
|
|
return ap || bp ;
|
return ap || bp ;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.