Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/interact.cfa

    re68d092 r3eb5a478  
    11// Testing Interactions Between Termination and Resumption
    22
    3 #include <exception.hfa>
     3#include "except-mac.hfa"
    44#include "except-io.hfa"
    55
     
    1010        // Resume falls back to terminate.
    1111        try {
    12                 throwResume &(star){};
     12                THROW_RESUME(&(star){});
    1313        } catch (star *) {
    1414                printf("caught as termination\n");
     
    1717        try {
    1818                loud_region a = "try block with resume throw";
    19                 throwResume &(star){};
     19                THROW_RESUME(&(star){});
    2020        } catch (star *) {
    2121                printf("caught as termination\n");
     
    2929        try {
    3030                try {
    31                         throw &(star){};
     31                        THROW(&(star){});
    3232                } catchResume (star *) {
    3333                        printf("resume catch on terminate\n");
     
    4343        try {
    4444                try {
    45                         throwResume &(star){};
     45                        THROW_RESUME(&(star){});
    4646                } catch (star *) {
    4747                        printf("terminate catch on resume\n");
     
    5858                try {
    5959                        try {
    60                                 throw &(star){};
     60                                THROW(&(star){});
    6161                        } catchResume (star *) {
    6262                                printf("inner resume catch (error)\n");
     
    6464                } catch (star * error) {
    6565                        printf("termination catch, will resume\n");
    66                         throwResume error;
     66                        THROW_RESUME(error);
    6767                }
    6868        } catchResume (star *) {
     
    7575                try {
    7676                        try {
    77                                 throwResume &(star){};
     77                                THROW_RESUME(&(star){});
    7878                        } catch (star *) {
    7979                                printf("inner termination catch\n");
     
    8181                } catchResume (star * error) {
    8282                        printf("resumption catch, will terminate\n");
    83                         throw error;
     83                        THROW(error);
    8484                }
    8585        } catch (star *) {
    8686                printf("outer terminate catch (error)\n");
    8787        }
     88#if 0
    8889        printf("\n");
    8990
     
    9495                                try {
    9596                                        printf("throwing resume moon\n");
    96                                         throwResume &(moon){};
     97                                        THROW_RESUME(&(moon){});
    9798                                } catch (star *) {
    9899                                        printf("termination catch\n");
    99100                                }
    100101                                printf("throwing resume star\n");
    101                                 throwResume &(star){};
     102                                THROW_RESUME(&(star){});
    102103                        } catchResume (star *) {
    103104                                printf("resumption star catch\n");
     
    105106                } catchResume (moon *) {
    106107                        printf("resumption moon catch, will terminate\n");
    107                         throw &(star){};
     108                        THROW(&(star){});
    108109                }
    109110        } catchResume (star *) {
    110111                printf("outermost catch (error)\n");
    111112        }
     113#endif
    112114}
Note: See TracChangeset for help on using the changeset viewer.