ADT
ast-experimental
enum
forall-pointer-decay
pthread-emulation
qualifiedEnum
Last change
on this file since 3b0bc16 was d00d581, checked in by Henry Xue <y58xue@…>, 4 years ago |
Update exception tests to use new syntax
|
-
Property mode
set to
100644
|
File size:
480 bytes
|
Line | |
---|
1 | // Make sure throw-catch during unwind does not trash internal data.
|
---|
2 |
|
---|
3 | exception yin {};
|
---|
4 | exception yang {};
|
---|
5 |
|
---|
6 | vtable(yin) yin_vt;
|
---|
7 | vtable(yang) yang_vt;
|
---|
8 |
|
---|
9 | int main(int argc, char * argv[]) {
|
---|
10 | try {
|
---|
11 | try {
|
---|
12 | throw (yin){&yin_vt};
|
---|
13 | } finally {
|
---|
14 | try {
|
---|
15 | throw (yang){&yang_vt};
|
---|
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.