view test/union2.d @ 153:2c447715c047 trunk

[svn r159] added some code to help diagnose ticket #35
author lindquist
date Tue, 25 Mar 2008 16:33:19 +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);}
    }
}