Changeset 6437ce4 for tests


Ignore:
Timestamp:
Jul 6, 2020, 4:54:56 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
4d23dd2, b56f55c
Parents:
ac9ba12 (diff), 381132b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests/exceptions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/.expect/defaults.txt

    rac9ba12 r6437ce4  
    33jump default handler.
    44Catch unhandled_exception.
     5cross terminate throw
     6cross terminate default
     7cross terminate catch
     8cross resume throw
     9cross resume default
     10cross resume catch
  • tests/exceptions/defaults.cfa

    rac9ba12 r6437ce4  
    3030                throwResume (log_message){(char *)"Should be printed.\n"};
    3131        } catchResume (log_message * this) {
    32                 printf(this->virtual_table->msg(this));
     32                printf("%s", this->virtual_table->msg(this));
    3333        }
    3434        // But we don't have to:
     
    6969}
    7070
     71TRIVIAL_EXCEPTION(second);
     72
     73void cross_test(void) {
     74        void defaultTerminationHandler(first &) {
     75                printf("cross terminate default\n");
     76                throw (second){};
     77        }
     78        void defaultResumptionHandler(first &) {
     79                printf("cross resume default\n");
     80                throwResume (second){};
     81        }
     82        try {
     83                printf("cross terminate throw\n");
     84                throw (first){};
     85        } catch (second *) {
     86                printf("cross terminate catch\n");
     87        }
     88        try {
     89                printf("cross resume throw\n");
     90                throwResume (first){};
     91        } catchResume (second *) {
     92                printf("cross resume catch\n");
     93        }
     94}
     95
    7196int main(int argc, char * argv[]) {
    7297        log_test();
    7398        jump_test();
    7499        unhandled_test();
     100        cross_test();
    75101}
Note: See TracChangeset for help on using the changeset viewer.