mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-10 17:03:13 +01:00
[svn r85] Fixed: if a return statement appeared in the try block of a nested try-finally, only the inner-most finally block would be executed.
Changed: Renamed all the LLVM_Dto... helper function to just Dto...
This commit is contained in:
27
test/scope5.d
Normal file
27
test/scope5.d
Normal file
@@ -0,0 +1,27 @@
|
||||
module scope5;
|
||||
|
||||
int i;
|
||||
|
||||
void func(int a, int b)
|
||||
{
|
||||
i = 0;
|
||||
{
|
||||
scope(exit) i++;
|
||||
if (a) {
|
||||
scope(exit) i++;
|
||||
if (b) return;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
func(0,0);
|
||||
assert(i == 2);
|
||||
func(1,1);
|
||||
assert(i == 2);
|
||||
func(1,0);
|
||||
assert(i == 4);
|
||||
}
|
||||
Reference in New Issue
Block a user