Ignore:
Timestamp:
Mar 5, 2020, 5:50:29 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
9306559f
Parents:
427854b
Message:

Added several tests for generators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/coroutine/suspend_then.cfa

    r427854b rdfa4360  
    1515
    1616#include <fstream.hfa>
    17 #include <coroutine.hfa>
    1817
    19 void then() {
    20 
    21 }
    22 
    23 coroutine Fibonacci { int fn; };                                                // used for communication
     18generator Fibonacci {
     19        int fn;                                                                         // used for communication
     20        int fn1, fn2;                                                           // retained between resumes
     21};
    2422
    2523void main( Fibonacci & fib ) with( fib ) {                              // called on first resume
    26         int fn1, fn2;                                                           // retained between resumes
    2724        fn = 0;  fn1 = fn;                                                      // 1st case
    2825        suspend { sout | "Then!"; }                                             // restart last resume
Note: See TracChangeset for help on using the changeset viewer.