Index: doc/working/exception/impl/test-main.c
===================================================================
--- doc/working/exception/impl/test-main.c	(revision 35dd0f42a24565056364798f0857efa19e720bf2)
+++ doc/working/exception/impl/test-main.c	(revision e4e9173c6c7fdb2b9d8cc160814b41074aaf2f7a)
@@ -1,5 +1,8 @@
 #include "exception.h"
 
+// Use: gcc -fexceptions -Wall -Werror -g exception.c test-main.c
+
 #include <stdio.h>
+#include <stdbool.h>
 
 // Translation Helpers:
@@ -7,4 +10,14 @@
 	struct __cleanup_hook __hidden_hook __attribute__((cleanup(function)))
 
+void __try_resume_node_new(struct __try_resume_node * node,
+        _Bool (*handler)(exception except)) {
+    node->next = shared_stack.top_resume;
+    shared_stack.top_resume = node;
+    node->try_to_handle = handler;
+}
+
+void __try_resume_node_delete(struct __try_resume_node * node) {
+    shared_stack.top_resume = node->next;
+}
 
 // Local Print On Exit:
@@ -19,4 +32,5 @@
 #define raii_t __attribute__((cleanup(raii_dtor))) struct raii_base_type
 
+// ===========================================================================
 // Runtime code (post-translation).
 void terminate(int except_value) {
@@ -34,57 +48,152 @@
 // Termination Test: Two handlers: no catch, catch
 void bar() {
-	void bar_try1() {
-		terminate(4);
+	raii_t a = {"bar function"};
+	{
+		void bar_try1() {
+			terminate(4);
+		}
+		void bar_catch1(int index, exception except) {
+			switch(except) {
+			case 1:
+				printf("bar caught exception 3.\n");
+				break;
+			default:
+				printf("INVALID INDEX in bar: %d (%d)\n", index, except);
+			}
+		}
+		int bar_match1(exception except) {
+			if (3 == except) {
+				return 1;
+			} else {
+				return 0;
+			}
+		}
+		__try_terminate(bar_try1, bar_catch1, bar_match1);
 	}
-	void bar_catch1(int index, exception except) {
-		switch(except) {
-		case 1:
-			printf("bar caught exception.\n");
-			break;
-		default:
-			printf("INVALID INDEX in bar: %d\n", except);
-		}
-	}
-	int bar_match1(exception except) {
-		if (3 == except) {
-			return 1;
-		} else {
-			return 0;
-		}
-	}
-	__try_terminate(bar_try1, bar_catch1, bar_match1);
 }
 
 void foo() {
-	void foo_try1() {
-		bar();
+	raii_t a = {"foo function"};
+	{
+		void foo_try1() {
+			bar();
+		}
+		void foo_catch1(int index, exception except) {
+			switch(index) {
+			case 1:
+				printf("foo caught exception 4.\n");
+				break;
+			case 2:
+				printf("foo caught exception 2.\n");
+				break;
+			default:
+				printf("INVALID INDEX in foo: %d (%d)\n", index, except);
+			}
+		}
+		int foo_match1(exception except) {
+			if (4 == except) {
+				return 1;
+			} else if (2 == except) {
+				return 2;
+			} else {
+				return 0;
+			}
+		}
+		__try_terminate(foo_try1, foo_catch1, foo_match1);
 	}
-	void foo_catch1(int index, exception except) {
-		switch(except) {
-		case 1:
-			printf("foo caught exception 4.\n");
-			break;
-		case 2:
-			printf("foo caught exception 2.\n");
-			break;
-		default:
-			printf("INVALID INDEX in foo: %d\n", except);
+}
+
+// Resumption Two Handler Test: no catch, catch.
+void beta() {
+	raii_t a = {"beta function"};
+	{
+		bool beta_handle1(exception except) {
+			if (3 == except) {
+				printf("beta caught exception 3\n");
+				return true;
+			} else {
+				return false;
+			}
+		}
+		struct __try_resume_node node
+			__attribute__((cleanup(__try_resume_node_delete)));
+		__try_resume_node_new(&node, beta_handle1);
+		{
+			resume(4);
 		}
 	}
-	int foo_match1(exception except) {
-		if (4 == except) {
-			return 1;
-		} else if (2 == except) {
-			return 2;
-		} else {
-			return 0;
+}
+void alpha() {
+	raii_t a = {"alpha function"};
+	{
+		bool alpha_handle1(exception except) {
+			if (2 == except) {
+				printf("alpha caught exception 2\n");
+				return true;
+			} else if (4 == except) {
+				printf("alpha caught exception 4\n");
+				return true;
+			} else {
+				return false;
+			}
+		}
+		struct __try_resume_node node
+			__attribute__((cleanup(__try_resume_node_delete)));
+		__try_resume_node_new(&node, alpha_handle1);
+		{
+			beta();
 		}
 	}
-	__try_terminate(foo_try1, foo_catch1, foo_match1);
 }
 
+// Finally Test:
+void farewell() {
+	{
+		void farewell_finally1() {
+			printf("See you next time\n");
+		}
+		CLEANUP(farewell_finally1);
+		{
+			printf("jump out of farewell\n");
+		}
+	}
+}
+
+// Resume-to-Terminate Test:
+void fallback() {
+	//raii_t a = {"fallback function\n"};
+	{
+		void fallback_try1() {
+			resume(1);
+		}
+		void fallback_catch1(int index, exception except) {
+			switch (index) {
+			case 1:
+				printf("fallback caught termination 1\n");
+				break;
+			default:
+				printf("INVALID INDEX in fallback: %d (%d)\n", index, except);
+			}
+		}
+		int fallback_match1(exception except) {
+			if (1 == except) {
+				return 1;
+			} else {
+				return 0;
+			}
+		}
+		__try_terminate(fallback_try1, fallback_catch1, fallback_match1);
+	}
+}
+
+// main: choose which tests to run
 int main(int argc, char * argv[]) {
 	raii_t a = {"main function"};
 
-	foo();
+	foo(); printf("\n");
+	alpha(); printf("\n");
+	farewell(); printf("\n");
+	fallback(); printf("\n");
+	// Uncaught termination test.
+	terminate(7);
 }
