OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.eh/] [terminate1.C] - Diff between revs 305 and 384

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 384
// { dg-do run  }
// { dg-do run  }
// Test that an exception thrown out of the constructor for the exception
// Test that an exception thrown out of the constructor for the exception
// object (i.e. "after completing evaluation of the expression to be thrown
// object (i.e. "after completing evaluation of the expression to be thrown
// but before the exception is caught") causes us to call terminate.
// but before the exception is caught") causes us to call terminate.
#include 
#include 
#include 
#include 
void my_terminate ()
void my_terminate ()
{
{
  std::exit (0);
  std::exit (0);
}
}
struct A
struct A
{
{
  A () {}
  A () {}
  A (const A&) { throw 1; }
  A (const A&) { throw 1; }
};
};
int main (void)
int main (void)
{
{
  std::set_terminate (my_terminate);
  std::set_terminate (my_terminate);
  A a;
  A a;
  try { throw a; }
  try { throw a; }
  catch (...) {}
  catch (...) {}
  return 1;
  return 1;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.