Changeset e9145a3 for src/tests/except-1.c
- Timestamp:
- Aug 17, 2017, 4:13:42 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8f6dfe7
- Parents:
- 21f0aa8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/except-1.c
r21f0aa8 re9145a3 5 5 #include <stdio.h> 6 6 7 #include "except-mac.h" 8 TRIVIAL_EXCEPTION(yin) 9 TRIVIAL_EXCEPTION(yang) 10 7 11 int main() 8 12 { 9 13 try { 10 throw 3; 14 yin a; 15 THROW(&a); 11 16 } 12 catch( 3) {17 catch( yin * err ) { 13 18 printf("First Caught\n"); 14 19 try { 15 throw 4; 20 yang b; 21 THROW(&b); 16 22 } 17 catch( 4) {23 catch( yang * err ) { 18 24 printf("Both Caught\n"); 19 25 } … … 23 29 try { 24 30 try { 25 throw 2; 31 yang c; 32 THROW(&c); 26 33 } 27 catch( 2) {34 catch( yang * err ) { 28 35 printf("First Catch and rethrow\n"); 29 36 throw; 30 37 } 31 38 } 32 catch( 2) {39 catch( yang * err ) { 33 40 printf("Second Catch\n"); 34 41 } … … 37 44 try { 38 45 try { 39 throw 5; 46 yin d; 47 THROW(&d); 40 48 } 41 catch( 5) {49 catch( yin * err ) { 42 50 printf("Throw before cleanup\n"); 43 throw 6; 51 yang e; 52 THROW(&e); 44 53 } 45 54 } 46 catch( 6) {55 catch( yang * err ) { 47 56 printf("Catch after cleanup\n"); 48 57 } … … 51 60 try { 52 61 try { 53 throw 7; 62 yin f; 63 THROW(&f); 54 64 } 55 catch( 7) {65 catch( yin * err ) { 56 66 printf("Caught initial throw.\n"); 57 67 try { 58 throw 8; 68 yang g; 69 THROW(&g); 59 70 } 60 catch( 8) {71 catch( yang * err ) { 61 72 printf("Caught intermediate throw.\n"); 62 73 } … … 64 75 } 65 76 } 66 catch( 7) {77 catch( yin * err ) { 67 78 printf("Caught final throw.\n"); 68 79 }
Note: See TracChangeset
for help on using the changeset viewer.