Files
ldc/test/union2.d
Tomas Lindquist Olsen 9804fe0fa3 [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...
2007-10-31 03:11:32 +01:00

18 lines
192 B
D

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);
}