repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.mike
/
eh23.C
blob
da2ac0ef39d94c79da314a6b7396491c83c5b663
1
// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2
// { dg-options "-fexceptions" }
3
4
#include <exception>
5
#include <stdlib.h>
6
7
struct double_fault { };
8
int fault_now;
9
10
class E {
11
public:
12
E() { }
13
E(const E&) {
14
if (fault_now)
15
throw double_fault();
16
}
17
};
18
19
void foo() {
20
try {
21
throw E();
22
} catch (...) {
23
fault_now = 1;
24
throw;
25
}
26
}
27
28
void bar() {
29
try {
30
foo();
31
} catch (E e) { // double fault here
32
}
33
}
34
35
void my_terminate() {
36
exit (0); // double faults should call terminate
37
}
38
39
main() {
40
std::set_terminate (my_terminate);
41
try {
42
bar();
43
} catch (...) {
44
return 1;
45
}
46
return 1;
47
}