Mercurial > projects > dstress
view run/s/scope_17_D.d @ 1576:b3e16c86558e
[Issue 1398] New: GDC doesn't generate correct code
<mariusmuja@gmail.com>
2007-08-04
http://d.puremagic.com/issues/show_bug.cgi?id=1398
author | thomask |
---|---|
date | Thu, 21 Feb 2008 15:20:08 +0000 |
parents | a4dc53fd9f2e |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Jarrett Billingsley <jarrett.billingsley@gmail.com> // @date@ 2007-03-30 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1087 // @desc@ [Issue 1087] Scope classes not destroyed in labeled statements in switches module dstress.run.s.scope_17_D; int i[]; scope class A{ ~this(){ i ~= 3; } } int main(){ i ~= 0; switch(i.length) { L2: scope a = new A(); scope(exit) i ~= 2; i ~= 1; break; case 1: goto L2; } i ~= 4; if([0, 1, 2, 3, 4] != i){ assert(0); } return 0; }