view test/union2.d @ 160:b77664331d06 trunk

[svn r176] Fixed a bug with class constructors.
author lindquist
date Sun, 04 May 2008 04:35:27 +0200
parents 61615fa85940
children
line wrap: on
line source

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;
        {assert(*p == 0);}
    }
}