Mercurial > projects > ldc
comparison test/scope5.d @ 81:3587401b6eeb trunk
[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...
author | lindquist |
---|---|
date | Thu, 01 Nov 2007 17:27:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
80:7299ff502248 | 81:3587401b6eeb |
---|---|
1 module scope5; | |
2 | |
3 int i; | |
4 | |
5 void func(int a, int b) | |
6 { | |
7 i = 0; | |
8 { | |
9 scope(exit) i++; | |
10 if (a) { | |
11 scope(exit) i++; | |
12 if (b) return; | |
13 i++; | |
14 } | |
15 } | |
16 i++; | |
17 } | |
18 | |
19 void main() | |
20 { | |
21 func(0,0); | |
22 assert(i == 2); | |
23 func(1,1); | |
24 assert(i == 2); | |
25 func(1,0); | |
26 assert(i == 4); | |
27 } |