source: tests/exceptions/trash.cfa @ 73f1b1c

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 73f1b1c was 980fb4e, checked in by Andrew Beach <ajbeach@…>, 4 years ago

Added a test for exceptions and made a patch to allow it to pass.

  • Property mode set to 100644
File size: 479 bytes
RevLine 
[980fb4e]1// Make sure throw-catch during unwind does not trash internal data.
2
3#include <exception.hfa>
4#include <stdio.h>
5
6TRIVIAL_EXCEPTION(yin);
7TRIVIAL_EXCEPTION(yang);
8
9int main(int argc, char * argv[]) {
10        try {
11                try {
12                        throw (yin){};
13                } finally {
14                        try {
15                                throw (yang){};
16                        } catch (yin *) {
17                                printf("inner yin\n");
18                        } catch (yang *) {
19                                printf("inner yang\n");
20                        }
21                }
22        } catch (yin *) {
23                printf("outer yin\n");
24        } catch (yang *) {
25                printf("outer yang\n");
26        }
27}
Note: See TracBrowser for help on using the repository browser.