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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [init7.C] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// simplified from testcase in Windows Developer Journal,
3
// submitted by eyal.ben-david@aks.com
4
 
5
// The initialization of a static local variable must be retried if a
6
// previous try finished by throwing an exception [stmt.dcl]/4
7
 
8
extern "C" void abort ();
9
 
10
struct foo {
11
  foo() { throw true; }
12
};
13
 
14
void bar() {
15
  static foo baz;
16
}
17
 
18
int main() {
19
  try {
20
    bar(); // must throw
21
  }
22
  catch (bool) {
23
    try {
24
      bar(); // must throw again!
25
    }
26
    catch (bool) {
27
      return 0;
28
    }
29
  }
30
  abort();
31
}

powered by: WebSVN 2.1.0

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