mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-13 10:23:14 +01:00
Add test from #308 to minitests.
This commit is contained in:
20
tests/mini/bug308_double_finally.d
Normal file
20
tests/mini/bug308_double_finally.d
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user