URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed operators
|
// GROUPS passed operators
|
// opr-new file
|
// opr-new file
|
// From: David Binderman 3841
|
// From: David Binderman 3841
|
// Date: Mon, 21 Jun 93 11:42:11 +0200
|
// Date: Mon, 21 Jun 93 11:42:11 +0200
|
// Subject: G++ 2.4.3 and operator new
|
// Subject: G++ 2.4.3 and operator new
|
// Message-ID: <9306210942.AA10276@slsvitt.us-es.sel.de>
|
// Message-ID: <9306210942.AA10276@slsvitt.us-es.sel.de>
|
|
|
int FLAG=0;
|
int FLAG=0;
|
|
|
#include
|
#include
|
|
|
extern "C" int printf( const char *, ...);
|
extern "C" int printf( const char *, ...);
|
|
|
void * operator new(size_t, const std::nothrow_t&) throw() { FLAG=1; return 0; }
|
void * operator new(size_t, const std::nothrow_t&) throw() { FLAG=1; return 0; }
|
|
|
class K {
|
class K {
|
private:
|
private:
|
int i;
|
int i;
|
public:
|
public:
|
K( int j) {
|
K( int j) {
|
i = j;
|
i = j;
|
}
|
}
|
};
|
};
|
|
|
int main(void)
|
int main(void)
|
{
|
{
|
K * pK = new (std::nothrow) K( 10);
|
K * pK = new (std::nothrow) K( 10);
|
if ( FLAG != 1 )
|
if ( FLAG != 1 )
|
{ printf ("FAIL\n"); return 1; }
|
{ printf ("FAIL\n"); return 1; }
|
else
|
else
|
printf ("PASS\n");
|
printf ("PASS\n");
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.