// Finally Clause Tests #include #include "except-io.hfa" exception myth {}; vtable(myth) myth_vt; int main(int argc, char * argv[]) { myth exc = {&myth_vt}; try { try { sout | "termination throw"; throw exc; } finally { loud_exit a = "termination inner finally"; sout | "finally during unwind"; } } catch (myth * error) { sout | "termination catch"; } finally { loud_exit a = "termination outer finally"; sout | "finally after catch"; } sout | nl; try { try { sout | "resumption throw"; throwResume exc; } finally { loud_exit a = "resumption inner finally"; sout | "finally after resume"; } } catchResume (myth * error) { sout | "resumption catch"; } finally { loud_exit a = "resumption outer finally"; sout | "finally after catch"; } sout | ""; try { sout | "walking out of try"; } finally { loud_exit a = "walking finally"; sout | "walking through finally"; } sout | ""; try { sout | "jumping out of try"; goto endoffunction; } finally { loud_exit a = "jumping finally"; sout | "jumping through finally"; } endoffunction: ; }