Mercurial > projects > ldc
view tests/mini/classes9.d @ 978:6a32d2e18175
Fix a latent bug in the asm code.
I think that technically, using "*m0" instead of "*0" allows LLVM to pick
between using the same memory as output 0 and using a new memory location.
(So far I haven't been able to construct a testcase that actually breaks
because of this, though)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Wed, 18 Feb 2009 03:38:12 +0100 |
parents | 1bb99290e03a |
children |
line wrap: on
line source
module classes9; class C { } class D : C { } class E { } class F : E { } void main() { { D d = new D; { C c = d; assert(c !is null); D d2 = cast(D)c; assert(d2 !is null); E e = cast(E)d; assert(e is null); F f = cast(F)d; assert(f is null); } } { F f = new F; { E e = f; assert(e !is null); F f2 = cast(F)e; assert(f2 !is null); C c = cast(C)f; assert(c is null); D d2 = cast(D)f; assert(d2 is null); } } }