1// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2// { dg-options "-fexceptions" }
3
4void foo() {
5  int i;
6  i = 42;
7  throw i;
8}
9
10void ee(int *);
11
12void bar() {
13  int i = 2;
14  ee(&i);
15}
16
17void ee(int *) { }
18
19int main() {
20  try {
21    foo();
22    return 3;
23  } catch (int& i) {
24    bar();
25    return i != 42;
26  }
27  return 2;
28}
29