ADT
arm-eh
ast-experimental
enum
forall-pointer-decay
jacob/cs343-translation
new-ast-unique-expr
pthread-emulation
qualifiedEnum
Last change
on this file since bf1914e was afe2939, checked in by Andrew Beach <ajbeach@…>, 5 years ago |
Removed #include <stdio.h> from tests that only use printf.
|
-
Property mode
set to
100644
|
File size:
460 bytes
|
Line | |
---|
1 | // Make sure throw-catch during unwind does not trash internal data.
|
---|
2 |
|
---|
3 | #include <exception.hfa>
|
---|
4 |
|
---|
5 | TRIVIAL_EXCEPTION(yin);
|
---|
6 | TRIVIAL_EXCEPTION(yang);
|
---|
7 |
|
---|
8 | int main(int argc, char * argv[]) {
|
---|
9 | try {
|
---|
10 | try {
|
---|
11 | throw (yin){};
|
---|
12 | } finally {
|
---|
13 | try {
|
---|
14 | throw (yang){};
|
---|
15 | } catch (yin *) {
|
---|
16 | printf("inner yin\n");
|
---|
17 | } catch (yang *) {
|
---|
18 | printf("inner yang\n");
|
---|
19 | }
|
---|
20 | }
|
---|
21 | } catch (yin *) {
|
---|
22 | printf("outer yin\n");
|
---|
23 | } catch (yang *) {
|
---|
24 | printf("outer yang\n");
|
---|
25 | }
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.