Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 0fa04a040608edf8bb8c9ef9bcf14e4f79b23feb)
+++ tests/Makefile.am	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -163,4 +163,11 @@
 	$(CFACOMPILETEST) -DERR2 -c -fsyntax-only -o $(abspath ${@})
 
+# Exception Tests
+# Test with libcfathread; it changes how storage works.
+
+exceptions/%-threads : exceptions/%.cfa $(CFACCBIN)
+	$(CFACOMPILETEST) -include exceptions/with-threads.hfa -c -o $(abspath ${@}).o
+	$(CFACCLOCAL) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) $(abspath ${@}).o -o $(abspath ${@})
+
 #------------------------------------------------------------------------------
 # Other targets
Index: tests/exceptions/.expect/conditional-threads.txt
===================================================================
--- tests/exceptions/.expect/conditional-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/exceptions/.expect/conditional-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,2 @@
+Caught num_error: expected=2 actual=2.
+Caught num_error: expected=2 actual=2.
Index: tests/exceptions/.expect/defaults-threads.txt
===================================================================
--- tests/exceptions/.expect/defaults-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/exceptions/.expect/defaults-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,10 @@
+Should be printed.
+jump catch handler.
+jump default handler.
+Catch unhandled_exception.
+cross terminate throw
+cross terminate default
+cross terminate catch
+cross resume throw
+cross resume default
+cross resume catch
Index: tests/exceptions/.expect/finally-threads.txt
===================================================================
--- tests/exceptions/.expect/finally-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/exceptions/.expect/finally-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,21 @@
+termination throw
+finally during unwind
+Exiting: termination inner finally
+termination catch
+finally after catch
+Exiting: termination outer finally
+
+resumption throw
+resumption catch
+finally after resume
+Exiting: resumption inner finally
+finally after catch
+Exiting: resumption outer finally
+
+walking out of try
+walking through finally
+Exiting: walking finally
+
+jumping out of try
+jumping through finally
+Exiting: jumping finally
Index: tests/exceptions/.expect/resume-threads.txt
===================================================================
--- tests/exceptions/.expect/resume-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/exceptions/.expect/resume-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,36 @@
+simple throw
+simple catch
+Exiting: simple catch clause
+end of try clause
+Exiting: simple try clause
+
+catch-all
+
+throwing child exception
+inner parent match
+
+caught yin as yin
+
+rethrow inner try
+caught throw, will rethrow
+Exiting: rethrowing catch clause
+caught rethrow
+Exiting: rethrow catch clause
+Exiting: rethrow inner try
+
+caught yin, will throw yang
+caught yang
+
+throwing first exception
+caught first exception
+throwing second exception
+caught second exception
+recaught first exception
+
+inner catch
+inner catch
+outer catch
+
+throw
+rethrow
+handle
Index: tests/exceptions/.expect/terminate-threads.txt
===================================================================
--- tests/exceptions/.expect/terminate-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/exceptions/.expect/terminate-threads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,34 @@
+simple throw
+Exiting: simple try clause
+simple catch
+Exiting: simple catch clause
+
+catch-all
+
+throwing child exception
+inner parent match
+
+caught yin as yin
+
+rethrow inner try
+Exiting: rethrow inner try
+caught throw, will rethrow
+Exiting: rethrowing catch clause
+caught rethrow
+Exiting: rethrow catch clause
+
+caught yin, will throw yang
+caught yang
+
+throwing first exception
+caught first exception
+throwing second exception
+caught second exception
+recaught first exception
+
+inner catch
+outer catch
+
+throw
+rethrow
+handle
Index: tests/exceptions/terminate.cfa
===================================================================
--- tests/exceptions/terminate.cfa	(revision 0fa04a040608edf8bb8c9ef9bcf14e4f79b23feb)
+++ tests/exceptions/terminate.cfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -142,3 +142,2 @@
 	}
 }
-
Index: tests/exceptions/with-threads.hfa
===================================================================
--- tests/exceptions/with-threads.hfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/exceptions/with-threads.hfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,8 @@
+// Header used to force linking with libcfathread.
+
+// I know its "with threads" but a coroutine is enough to bring it all in.
+#include <coroutine.hfa>
+
+coroutine DummyCoroutine {};
+
+DummyCoroutine ignored_dummy_coroutine;
Index: tests/linking/.expect/exception-nothreads.txt
===================================================================
--- tests/linking/.expect/exception-nothreads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/linking/.expect/exception-nothreads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,1 @@
+no threads
Index: tests/linking/.expect/exception-withthreads.txt
===================================================================
--- tests/linking/.expect/exception-withthreads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/linking/.expect/exception-withthreads.txt	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,1 @@
+with threads
Index: tests/linking/exception-nothreads.cfa
===================================================================
--- tests/linking/exception-nothreads.cfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/linking/exception-nothreads.cfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,33 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// exception-nothreads.cfa --
+//
+// Author           : Andrew Beach
+// Created On       : Thr 13 16:12:00 2020
+// Last Modified By : Andrew Beach
+// Last Modified On : Thr 13 16:49:00 2020
+// Update Count     : 0
+//
+
+#include <stdlib.hfa>
+#include <exception.hfa>
+
+TRIVIAL_EXCEPTION(ping);
+
+int main(void) {
+	try {
+		throwResume (ping){};
+	} catchResume (ping *) {
+		printf("%s threads\n", threading_enabled() ? "with" : "no");
+	}
+	return 0;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa nothreads.cfa" //
+// End: //
Index: tests/linking/exception-withthreads.cfa
===================================================================
--- tests/linking/exception-withthreads.cfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
+++ tests/linking/exception-withthreads.cfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -0,0 +1,34 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// exception-withthreads.cfa --
+//
+// Author           : Andrew Beach
+// Created On       : Thr 13 16:12:00 2020
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri 14 11:20:00 2020
+// Update Count     : 0
+//
+
+#include <stdlib.hfa>
+#include <exception.hfa>
+#include "../exceptions/with-threads.hfa"
+
+TRIVIAL_EXCEPTION(ping);
+
+int main(void) {
+	try {
+		throwResume (ping){};
+	} catchResume (ping *) {
+		printf("%s threads\n", threading_enabled() ? "with" : "no");
+	}
+	return 0;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa nothreads.cfa" //
+// End: //
Index: tests/linking/withthreads.cfa
===================================================================
--- tests/linking/withthreads.cfa	(revision 0fa04a040608edf8bb8c9ef9bcf14e4f79b23feb)
+++ tests/linking/withthreads.cfa	(revision 794db28fedf4d56b2d4db3057c6825fe0fab19e9)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// nothreads.cfa --
+// withthreads.cfa --
 //
 // Author           : Thierry Delisle
