Ignore:
Timestamp:
Jun 26, 2023, 10:51:47 AM (2 years ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
917e1fd
Parents:
adc73a5 (diff), 1fbf481 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/cancel/coroutine.cfa

    radc73a5 r48ec19a  
    11// Try cancelling a coroutine.
    22
     3#include <fstream.hfa>
    34#include <coroutine.hfa>
    45
     
    1314
    1415void main(WillCancel & wc) {
    15         printf("1");
     16        sout | '1';
    1617        cancel_stack((internal_error){&internal_vt});
    17         printf("!");
     18        sout | '!';
    1819}
    1920
    2021int main(int argc, char * argv[]) {
     22        sout | nlOff;
    2123        WillCancel cancel;
    2224        try {
    23                 printf("0");
     25                sout | '0';
    2426                resume(cancel);
    25                 printf("4");
     27                sout | '4';
    2628        } catchResume (CoroutineCancelled(WillCancel) * error) {
    27                 printf("2");
     29                sout | '2';
    2830                if ((virtual internal_error *)error->the_exception) {
    29                         printf("3");
     31                        sout | '3';
    3032                }
    3133        }
    32         printf("5\n");
     34        sout | '5' | nl;
    3335}
Note: See TracChangeset for help on using the changeset viewer.