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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.eh/] [terminate1.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run }
2
// Test that an exception thrown out of the constructor for the catch
3
// parameter (i.e. "after completing evaluation of the expression to be thrown
4
// but before the exception is caught") causes us to call terminate.
5
 
6
#include 
7
#include 
8
 
9
void my_terminate ()
10
{
11
  std::exit (0);
12
}
13
 
14
struct A
15
{
16
  A () {}
17
  A (const A&) { throw 1; }
18
};
19
 
20
int main (void)
21
{
22
  std::set_terminate (my_terminate);
23
 
24
  try { throw A(); }
25
  catch (A) {}
26
  return 1;
27
}

powered by: WebSVN 2.1.0

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