gcc/testsuite/g++.old-deja/g++.other/eh3.C
raw| 1 | // { dg-do run } |
| 2 | // { dg-options "-O" } |
| 3 | |
| 4 | typedef struct { } e; |
| 5 | |
| 6 | char *p; |
| 7 | |
| 8 | void _Jv_throw (); |
| 9 | |
| 10 | int barf (int len) |
| 11 | { |
| 12 | char a[len]; |
| 13 | |
| 14 | p = a; |
| 15 | _Jv_throw (); |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | void _Jv_throw () |
| 20 | { |
| 21 | e ex; |
| 22 | throw ex; |
| 23 | } |
| 24 | |
| 25 | int main () |
| 26 | { |
| 27 | try { |
| 28 | barf (2); |
| 29 | } |
| 30 | catch (...) { |
| 31 | } |
| 32 | |
| 33 | return 0; |
| 34 | } |