Ignore:
Timestamp:
May 19, 2020, 5:31:20 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
918b90c
Parents:
7d6e01d
Message:

That should get default operations working for throws. More tests to come.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/terminate.cfa

    r7d6e01d r046a890  
    1414                loud_exit a = "simple try clause";
    1515                printf("simple throw\n");
    16                 throw &(zen){};
     16                throw (zen){};
    1717                printf("end of try clause\n");
    1818        } catch (zen * error) {
     
    2424        // Throw catch-all test.
    2525        try {
    26                 throw &(zen){};
     26                throw (zen){};
    2727        } catch (exception_t * error) {
    2828                printf("catch-all\n");
     
    3333        try {
    3434                printf("throwing child exception\n");
    35                 throw &(moment_of){};
     35                throw (moment_of){};
    3636        } catch (zen *) {
    3737                printf("inner parent match\n");
     
    4444        try {
    4545                try {
    46                         throw &(yin){};
     46                        throw (yin){};
    4747                } catch (zen *) {
    4848                        printf("caught yin as zen\n");
     
    6060                        loud_exit a = "rethrow inner try";
    6161                        printf("rethrow inner try\n");
    62                         throw &(zen){};
     62                        throw (zen){};
    6363                } catch (zen *) {
    6464                        loud_exit a = "rethrowing catch clause";
     
    7575        try {
    7676                try {
    77                         throw &(yin){};
     77                        throw (yin){};
    7878                } catch (yin *) {
    7979                        printf("caught yin, will throw yang\n");
    80                         throw &(yang){};
     80                        throw (yang){};
    8181                } catch (yang *) {
    8282                        printf("caught exception from same try\n");
     
    9191                try {
    9292                        printf("throwing first exception\n");
    93                         throw &(yin){};
     93                        throw (yin){};
    9494                } catch (yin *) {
    9595                        printf("caught first exception\n");
    9696                        try {
    9797                                printf("throwing second exception\n");
    98                                 throw &(yang){};
     98                                throw (yang){};
    9999                        } catch (yang *) {
    100100                                printf("caught second exception\n");
     
    112112        try {
    113113                try {
    114                         throw &(zen){};
    115                         throw &(zen){};
     114                        throw (zen){};
     115                        throw (zen){};
    116116                } catch (zen *) {
    117117                        printf("inner catch\n");
    118118                }
    119                 throw &(zen){};
     119                throw (zen){};
    120120        } catch (zen *) {
    121121                printf("outer catch\n");
Note: See TracChangeset for help on using the changeset viewer.