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++.old-deja/] [g++.eh/] [spec4.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// { 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.