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

Subversion Repositories openrisc

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

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

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
#include 
#include 
#include 
#include 
#include 
#include 
static void
static void
eh_terminate ()
eh_terminate ()
{
{
  printf ("CALLING TERMINATE\n");
  printf ("CALLING TERMINATE\n");
  exit (1);
  exit (1);
}
}
void
void
eh_test (int level)
eh_test (int level)
{
{
  try
  try
    {
    {
      if (level < 2)
      if (level < 2)
        eh_test (level + 1);
        eh_test (level + 1);
      else
      else
        {
        {
          printf ("%d: Throwing\n", level);
          printf ("%d: Throwing\n", level);
          throw (level);
          throw (level);
        }
        }
    }
    }
  catch (int &x)
  catch (int &x)
    {
    {
      printf ("%d: Got level %d\n",
      printf ("%d: Got level %d\n",
              level, x);
              level, x);
      if (level > 0)
      if (level > 0)
        throw;
        throw;
    }
    }
}
}
int main ()
int main ()
{
{
  std::set_terminate (&eh_terminate);
  std::set_terminate (&eh_terminate);
  eh_test (0);
  eh_test (0);
}
}
 
 

powered by: WebSVN 2.1.0

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