OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [cond4.C] - Rev 693

Compare with Previous | Blame | View Log

// Runtime version of cond3.C.  We call terminate when the A cleanup throws
// because we've already initialized the exception object.
// { dg-do run }

#include <exception>
#include <cstdlib>

void my_terminate ()
{
  std::exit (0);
}

struct A {
  A(int) { }
  ~A() { throw 1; };
};
struct B {
  B(A) { }
  ~B() { }
};
bool b;

int main()
{
  std::set_terminate (my_terminate);
  try
    {
      throw b ? B(1) : B(1);
    }
  catch (...) { }
  return 1;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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