1 import core
.stdc
.stdio
: fprintf
, stderr
;
3 class MyException
: Exception
5 this() { super(typeof(this).stringof
); }
12 throw new MyException
;
23 // Test that exceptions that are entirely thrown and caught in finally blocks don't affect exception handling.
30 throw new Exception("p");
43 // Test that exceptions that are entirely thrown and caught in finally blocks don't interfere with chaining.
52 throw new Exception("p");
56 throw new Exception("q");
67 assert(e
.next
.msg
== "q");
80 throw new Exception("p");
89 throw new Exception("q");
95 assert(e
.next
.msg
== "q");
100 // Test order of exception handler operations.
106 pragma(inline
, false);
110 throw new MyException
;
126 throw new Exception("");
137 assert(result
== "abcd");
146 throw new Exception("a");
151 pragma(inline
, false);
158 assert(e
.msg
== "a");
168 throw new Exception("x");
177 assert(e
.msg
== "x");
181 assert(result
== "abcd");
190 fprintf(stderr
, "success.\n");