Index: src/tests/coroutine/coroutine.c
===================================================================
--- src/tests/coroutine/coroutine.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
+++ src/tests/coroutine/coroutine.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
@@ -0,0 +1,59 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// fibonacci.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Thu Jun  8 07:29:37 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun Sep 17 21:38:15 2017
+// Update Count     : 7
+//
+
+#include <fstream>
+#include <coroutine>
+
+coroutine Fibonacci {
+	int fn;												// used for communication
+};
+
+void ?{}( Fibonacci & this ) {
+	this.fn = 0;
+}
+
+void main( Fibonacci & this ) {
+	int fn1, fn2;										// retained between resumes
+	this.fn = 0;										// case 0
+	fn1 = this.fn;
+	suspend();											// restart last resume
+
+	this.fn = 1;										// case 1
+	fn2 = fn1;  fn1 = this.fn;
+	suspend();											// restart last resume
+
+	for ( ;; ) {										// general case
+		this.fn = fn1 + fn2;
+		fn2 = fn1;  fn1 = this.fn;
+		suspend();										// restart last resume
+	} // for
+}
+
+int next( Fibonacci & this ) {
+	resume( this );										// restart last suspend
+	return this.fn;
+}
+
+int main() {
+	Fibonacci f1, f2;
+	for ( int i = 1; i <= 10; i += 1 ) {
+		sout | next( f1 ) | next( f2 ) | endl;
+	} // for
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa fibonacci.c" //
+// End: //
Index: src/tests/coroutine/fmtLines.c
===================================================================
--- src/tests/coroutine/fmtLines.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
+++ src/tests/coroutine/fmtLines.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
@@ -0,0 +1,67 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// fmtLines.cc -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Sun Sep 17 21:56:15 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun Oct  1 11:57:19 2017
+// Update Count     : 34
+// 
+
+#include <fstream>
+#include <coroutine>
+
+coroutine Format {
+	char ch;											// used for communication
+	int g, b;											// global because used in destructor
+};
+
+void ?{}( Format & fmt ) {
+	resume( fmt );										// prime (start) coroutine
+}
+
+void ^?{}( Format & fmt ) {
+	if ( fmt.g != 0 || fmt.b != 0 ) sout | endl;
+}
+
+void main( Format & fmt ) {
+	for ( ;; ) {										// for as many characters
+		for ( fmt.g = 0; fmt.g < 5; fmt.g += 1 ) {		// groups of 5 blocks
+			for ( fmt.b = 0; fmt.b < 4; fmt.b += 1 ) {	// blocks of 4 characters
+				for ( ;; ) {							// for newline characters
+					suspend();
+					if ( fmt.ch != '\n' ) break;		// ignore newline
+				} // for
+				sout | fmt.ch;							// print character
+			} // for
+			sout | "  ";								// print block separator
+		} // for
+		sout | endl;									// print group separator
+	} // for
+} // main
+
+void prt( Format & fmt, char ch ) {
+	fmt.ch = ch;
+	resume( fmt );
+} // prt
+
+int main() {
+	Format fmt;											// format characters into blocks of 4 and groups of 5 blocks per line
+	char ch;
+
+	Eof: for ( ;; ) {									// read until end of file
+		sin | ch;										// read one character
+	  if ( eof( sin ) ) break Eof;						// eof ?
+		prt( fmt, ch );									// push character for formatting
+	} // for
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa fmtLines.c" //
+// End: //
Index: src/tests/coroutine/pingpong.c
===================================================================
--- src/tests/coroutine/pingpong.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
+++ src/tests/coroutine/pingpong.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
@@ -0,0 +1,55 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// pingpong.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Sep 20 11:55:23 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Sep 20 13:41:39 2017
+// Update Count     : 26
+// 
+
+#include <coroutine>
+#include <fstream>
+
+coroutine PingPong {
+	const char * name;
+	/* const */ unsigned int N;
+	PingPong * part;
+};
+
+void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) {
+	this.name = name;
+	this.N = N;
+	this.part = &part;
+}
+void ?{}( PingPong & this, const char * name, unsigned int N ) {
+	this{ name, N, *(PingPong *)0 };
+}
+void cycle( PingPong & pingpong ) {
+	resume( pingpong );
+}
+void partner( PingPong & this, PingPong & part ) {
+	this.part = &part;
+	resume( this );
+}
+void main( PingPong & pingpong ) {						// ping's starter ::main, pong's starter ping
+	for ( unsigned int i = 0; i < pingpong.N; i += 1 ) {
+		sout | pingpong.name | endl;
+		cycle( *pingpong.part );
+	} // for
+}
+int main() {
+	enum { N = 20 };
+	PingPong ping = { "ping", N }, pong = { "pong", N, ping };
+	partner( ping, pong );
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa pingpong.c" //
+// End: //
Index: src/tests/coroutine/prodcons.c
===================================================================
--- src/tests/coroutine/prodcons.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
+++ src/tests/coroutine/prodcons.c	(revision 557435e22bc33d5b46d38478863149e4bb72817e)
@@ -0,0 +1,100 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// prodcons.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Mon Sep 18 12:23:39 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Oct 30 23:06:05 2017
+// Update Count     : 42
+// 
+
+#include <fstream>
+#include <coroutine>
+#include <stdlib>										// random
+#include <unistd.h>										// getpid
+
+coroutine Cons;											// forward
+int delivery( Cons & cons, int p1, int p2 );
+void stop( Cons & cons );
+
+coroutine Prod {
+	Cons *c;
+	int N, money, receipt;
+};
+void main( Prod & prod ) {								// starter ::main
+	// 1st resume starts here
+	for ( int i = 0; i < prod.N; i += 1 ) {
+		int p1 = random( 100 );
+		int p2 = random( 100 );
+		sout | p1 | " " | p2 | endl;
+		int status = delivery( *prod.c, p1, p2 );
+		sout | " $" | prod.money | endl;
+		sout | status | endl;
+		prod.receipt += 1;
+	}
+	stop( *prod.c );
+	sout | "prod stops" | endl;
+}
+int payment( Prod & prod, int money ) {
+	prod.money = money;
+	resume( prod );										// main 1st time, then
+	return prod.receipt;								// prod in delivery
+}
+void start( Prod & prod, int N, Cons &c ) {
+	prod.N = N;
+	prod.c = &c;
+	prod.receipt = 0;
+	resume( prod );										// activate main
+}
+
+coroutine Cons {
+	Prod * p;
+	int p1, p2, status;
+	bool done;
+};
+void ?{}( Cons & cons, Prod & p ) {
+	cons.p = &p;
+	cons.status = 0;
+	cons.done = false;
+}
+void ^?{}( Cons & cons ) {}
+void main( Cons & cons ) {								// starter prod
+	// 1st resume starts here
+	int money = 1, receipt;
+	for ( ; ! cons.done; ) {
+		sout | cons.p1 | " " | cons.p2 | endl;
+		sout | " $" | money | endl;
+		cons.status += 1;
+		receipt = payment( *cons.p, money );
+		sout | " #" | receipt | endl;
+		money += 1;
+	}
+	sout | "cons stops" | endl;
+}
+int delivery( Cons & cons, int p1, int p2 ) {
+	cons.p1 = p1;
+	cons.p2 = p2;
+	resume( cons );										// main 1st time, then
+	return cons.status;									// cons in payment
+}
+void stop( Cons & cons ) {
+	cons.done = true;
+	resume( cons );										// activate payment
+}
+int main() {
+	Prod prod;
+	Cons cons = { prod };
+	random_seed( /* getpid() */ 103 );					// fixed seed for testing
+	start( prod, 5, cons );
+	sout | "main stops" | endl;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa prodcons.c" //
+// End: //
