- Timestamp:
- Dec 6, 2016, 4:16:47 PM (8 years ago)
- 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
- Location:
- src/tests
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/tests/coroutine.c
re4745d7a rd9c44c3 28 28 29 29 void co_main(Fibonacci* this) { 30 #ifdef MORE_DEBUG 30 31 sout | "Starting main of coroutine " | this | endl; 31 32 sout | "Started from " | this_coroutine(this)->last | endl; 33 #endif 32 34 int fn1, fn2; // retained between resumes 33 35 this->fn = 0; … … 62 64 63 65 int 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 66 70 for ( int i = 1; i <= 10; i += 1 ) { 67 sout | next(&f1) | endl;71 sout | next(&f1) | ' ' | next(&f2) | endl; 68 72 } 69 73
Note: See TracChangeset
for help on using the changeset viewer.