Changeset ecfd758 for tests/exceptions/interact.cfa
- Timestamp:
- Apr 9, 2021, 2:11:43 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b91bfde
- Parents:
- e07b589
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/interact.cfa
re07b589 recfd758 4 4 #include "except-io.hfa" 5 5 6 TRIVIAL_EXCEPTION(star); 7 TRIVIAL_EXCEPTION(moon); 6 EHM_EXCEPTION(star)(); 7 EHM_EXCEPTION(moon)(); 8 9 EHM_VIRTUAL_TABLE(star, star_vt); 10 EHM_VIRTUAL_TABLE(moon, moon_vt); 8 11 9 12 int main(int argc, char * argv[]) { 10 13 // Resume falls back to terminate. 11 14 try { 12 throwResume (star){ };15 throwResume (star){&star_vt}; 13 16 } catch (star *) { 14 17 printf("caught as termination\n"); … … 17 20 try { 18 21 loud_region a = "try block with resume throw"; 19 throwResume (star){ };22 throwResume (star){&star_vt}; 20 23 } catch (star *) { 21 24 printf("caught as termination\n"); … … 29 32 try { 30 33 try { 31 throw (star){ };34 throw (star){&star_vt}; 32 35 } catchResume (star *) { 33 36 printf("resume catch on terminate\n"); … … 43 46 try { 44 47 try { 45 throwResume (star){ };48 throwResume (star){&star_vt}; 46 49 } catch (star *) { 47 50 printf("terminate catch on resume\n"); … … 58 61 try { 59 62 try { 60 throw (star){ };63 throw (star){&star_vt}; 61 64 } catchResume (star *) { 62 65 printf("inner resume catch (error)\n"); … … 75 78 try { 76 79 try { 77 throwResume (star){ };80 throwResume (star){&star_vt}; 78 81 } catch (star *) { 79 82 printf("inner termination catch\n"); … … 94 97 try { 95 98 printf("throwing resume moon\n"); 96 throwResume (moon){ };99 throwResume (moon){&moon_vt}; 97 100 } catch (star *) { 98 101 printf("termination catch\n"); 99 102 } 100 103 printf("throwing resume star\n"); 101 throwResume (star){ };104 throwResume (star){&star_vt}; 102 105 } catchResume (star *) { 103 106 printf("resumption star catch\n"); … … 105 108 } catchResume (moon *) { 106 109 printf("resumption moon catch, will terminate\n"); 107 throw (star){ };110 throw (star){&star_vt}; 108 111 } 109 112 } catchResume (star *) {
Note: See TracChangeset
for help on using the changeset viewer.