diff --git a/tests/mini/bug308_double_finally.d b/tests/mini/bug308_double_finally.d new file mode 100644 index 00000000..961aa581 --- /dev/null +++ b/tests/mini/bug308_double_finally.d @@ -0,0 +1,20 @@ +extern(C) int printf(char*, ...); + +long foo(ref int p) { + try { return 0; } + finally { + p++; + throw new Object; + } +} + +void main() { + int p = 0; + try { + foo(p); + assert(0); + } catch { + } + printf("Number of types scope(exit) was executed : %d\n", p); + assert(p == 1); +} \ No newline at end of file