Mercurial > projects > ldc
diff test/union2.d @ 73:b706170e24a9 trunk
[svn r77] Fixed foreach on slice.
Fixed some nested function problems when accessing outer function parameters.
Major changes to handling of structs.
Initial support for unions.
Probably more...
author | lindquist |
---|---|
date | Wed, 31 Oct 2007 03:11:32 +0100 |
parents | |
children | 61615fa85940 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/union2.d Wed Oct 31 03:11:32 2007 +0100 @@ -0,0 +1,17 @@ +module union2; + +pragma(LLVM_internal, "notypeinfo") +union U +{ + float f; + long l; +} + +U u; + +void main() +{ + assert(u.f !<>= 0); + uint* p = 1 + cast(uint*)&u.l; + assert(*p == 0); +}