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/] [spec1.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Testing exception specifications.
3
// Test 1: the original exception succeeds.
4
 
5
#include 
6
#include 
7
 
8
void my_term ()  { exit (1); }
9
void my_unexp () { throw 42; }
10
 
11
void
12
f () throw (char, int, std::bad_exception)
13
{
14
  throw 'a';
15
}
16
 
17
int main ()
18
{
19
  std::set_terminate (my_term);
20
  std::set_unexpected (my_unexp);
21
 
22
  try
23
    {
24
      f ();
25
    }
26
  catch (char)
27
    {
28
      return 0;
29
    }
30
  catch (int)
31
    {
32
      return 3;
33
    }
34
  catch (std::bad_exception)
35
    {
36
      return 4;
37
    }
38
  return 5;
39
}

powered by: WebSVN 2.1.0

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