Changeset d9c44c3 for src/tests


Ignore:
Timestamp:
Dec 6, 2016, 4:16:47 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
fa66f4e
Parents:
e4745d7a
Message:

Implemented coroutine for i386 and added coroutines to tests

Location:
src/tests
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • src/tests/coroutine.c

    re4745d7a rd9c44c3  
    2828
    2929void co_main(Fibonacci* this) {
     30#ifdef MORE_DEBUG
    3031      sout | "Starting main of coroutine " | this | endl;
    3132      sout | "Started from " | this_coroutine(this)->last | endl;
     33#endif
    3234      int fn1, fn2;             // retained between resumes
    3335      this->fn = 0;
     
    6264
    6365int main() {
    64       Fibonacci f1;
    65       sout | "User coroutine : " | &f1 | endl;
     66      Fibonacci f1, f2;
     67#ifdef MORE_DEBUG     
     68      sout | "User coroutines : " | &f1 | ' ' | &f1 | endl;
     69#endif
    6670      for ( int i = 1; i <= 10; i += 1 ) {
    67             sout | next(&f1) | endl;
     71            sout | next(&f1) | ' ' | next(&f2) | endl;
    6872      }
    6973
Note: See TracChangeset for help on using the changeset viewer.