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/] [spec4.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  }
// Testing exception specifications.
// Testing exception specifications.
// Test 4: all throws fail, call terminate.
// Test 4: all throws fail, call terminate.
#include 
#include 
#include 
#include 
void my_term ()  { exit (0); }
void my_term ()  { exit (0); }
void my_unexp () { throw 42; }
void my_unexp () { throw 42; }
void
void
f () throw (short)
f () throw (short)
{
{
  throw 'a';
  throw 'a';
}
}
int main ()
int main ()
{
{
  std::set_terminate (my_term);
  std::set_terminate (my_term);
  std::set_unexpected (my_unexp);
  std::set_unexpected (my_unexp);
  try
  try
    {
    {
      f ();
      f ();
    }
    }
  catch (char)
  catch (char)
    {
    {
      return 2;
      return 2;
    }
    }
  catch (int)
  catch (int)
    {
    {
      return 3;
      return 3;
    }
    }
  catch (std::bad_exception)
  catch (std::bad_exception)
    {
    {
      return 4;
      return 4;
    }
    }
  return 5;
  return 5;
}
}
 
 

powered by: WebSVN 2.1.0

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