view test/union1.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 b706170e24a9
children
line wrap: on
line source

module union1;

pragma(LLVM_internal, "notypeinfo")
union U
{
    float f;
    int i;
}

void main()
{
    float f = 2;
    U u = U(f);
    assert(u.i == *cast(int*)&f);
}