view test/union2.d @ 128:e5fe8521bbfa trunk

[svn r132] Added some tests. some will fail at the moment.
author lindquist
date Fri, 30 Nov 2007 17:12:08 +0100
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);}
    }
}