| 8 | } |
| 9 | |
| 10 | int main() { |
| 11 | int jmpval = setjmp(buf); |
| 12 | if (jmpval != 0) { |
| 13 | // This is not reached, because foo() doesn't longjmp. This test checks |
| 14 | // compilation of a setjmp call with a nested try. |
| 15 | printf("setjmp returned for the second time\n"); |
| 16 | return 0; |
| 17 | } |
| 18 | try { |
| 19 | foo(); |
| 20 | try { |
| 21 | foo(); |
| 22 | } catch (int n) { |
| 23 | printf("inner catch: caught %d\n", n); |
| 24 | } |
| 25 | } catch (int n) { |
| 26 | printf("outer catch: caught %d\n", n); |
| 27 | } |
| 28 | return 0; |
| 29 | } |