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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [eh/] [filter2.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// Test that terminate gets run when a catch filter fails to match while
// Test that terminate gets run when a catch filter fails to match while
// running destructors.  Original bug depended on a::~a being inlined.
// running destructors.  Original bug depended on a::~a being inlined.
// { dg-do run }
// { dg-do run }
// { dg-options -O }
// { dg-options -O }
#include 
#include 
#include 
#include 
struct e1 {};
struct e1 {};
struct e2 {};
struct e2 {};
struct a
struct a
{
{
  a () { }
  a () { }
  ~a ()
  ~a ()
    {
    {
      try
      try
        {
        {
          throw e1();
          throw e1();
        }
        }
      catch (e2 &)
      catch (e2 &)
        {
        {
        }
        }
    }
    }
};
};
void
void
ex_test ()
ex_test ()
{
{
  a aa;
  a aa;
  try
  try
    {
    {
      throw e1 ();
      throw e1 ();
    }
    }
  catch (e2 &)
  catch (e2 &)
    {
    {
    }
    }
}
}
void my_terminate ()
void my_terminate ()
{
{
  std::exit (0);
  std::exit (0);
}
}
int
int
main ()
main ()
{
{
  std::set_terminate (my_terminate);
  std::set_terminate (my_terminate);
  try
  try
    {
    {
      ex_test ();
      ex_test ();
    }
    }
  catch (...)
  catch (...)
    {
    {
    }
    }
  abort ();
  abort ();
}
}
 
 

powered by: WebSVN 2.1.0

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