// Draft memory management test. (remember -fexceptions) // Outdated: The integer constant exceptions need to be replaced with virtual // exceptions for the new system. #include int main() { try { throw 3; } catch( 3 ) { printf("First Caught\n"); try { throw 4; } catch( 4 ) { printf("Both Caught\n"); } } printf("Part A Complete\n"); try { try { throw 2; } catch( 2 ) { printf("First Catch and rethrow\n"); throw; } } catch( 2 ) { printf("Second Catch\n"); } printf("Part B Complete\n"); try { try { throw 5; } catch( 5 ) { printf("Throw before cleanup\n"); throw 6; } } catch( 6 ) { printf("Catch after cleanup\n"); } printf("Part C Complete\n"); try { try { throw 7; } catch( 7 ) { printf("Caught initial throw.\n"); try { throw 8; } catch( 8 ) { printf("Caught intermediate throw.\n"); } throw; } } catch( 7 ) { printf("Caught final throw.\n"); } printf("Part D Complete\n"); }