source: tests/exceptions/trash.cfa @ 6047b00

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 6047b00 was afe2939, checked in by Andrew Beach <ajbeach@…>, 4 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
5TRIVIAL_EXCEPTION(yin);
6TRIVIAL_EXCEPTION(yang);
7
8int 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.