Index: tests/exceptions/cancel/.expect/coroutine.txt
===================================================================
--- tests/exceptions/cancel/.expect/coroutine.txt	(revision 4c868cb2d605f52664207c4a1a18ed9f041e2057)
+++ tests/exceptions/cancel/.expect/coroutine.txt	(revision 4c868cb2d605f52664207c4a1a18ed9f041e2057)
@@ -0,0 +1,1 @@
+012345
Index: tests/exceptions/cancel/coroutine.cfa
===================================================================
--- tests/exceptions/cancel/coroutine.cfa	(revision 4c868cb2d605f52664207c4a1a18ed9f041e2057)
+++ tests/exceptions/cancel/coroutine.cfa	(revision 4c868cb2d605f52664207c4a1a18ed9f041e2057)
@@ -0,0 +1,34 @@
+// Try cancelling a coroutine.
+
+#include <stdio.h>
+#include <coroutine.hfa>
+#include <exception.hfa>
+
+TRIVIAL_EXCEPTION(internal_error);
+
+coroutine WillCancel {};
+
+const char * msg(CoroutineCancelled(WillCancel) * this) {
+	return "CoroutineCancelled(WillCancel)";
+}
+
+void main(WillCancel & wc) {
+	printf("1");
+	cancel_stack((internal_error){});
+	printf("!");
+}
+
+int main(int argc, char * argv[]) {
+	WillCancel cancel;
+	try {
+		printf("0");
+		resume(cancel);
+		printf("4");
+	} catchResume (CoroutineCancelled(WillCancel) * error) {
+		printf("2");
+		if ((virtual internal_error *)error->the_exception) {
+			printf("3");
+		}
+	}
+	printf("5\n");
+}
