annotate tests/mini/union2.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents test/union2.d@61615fa85940
children 44f08170f4ef
rev   line source
lindquist@73 1 module union2;
lindquist@73 2
lindquist@73 3 pragma(LLVM_internal, "notypeinfo")
lindquist@73 4 union U
lindquist@73 5 {
lindquist@73 6 float f;
lindquist@73 7 long l;
lindquist@73 8 }
lindquist@73 9
lindquist@73 10 U u;
lindquist@73 11
lindquist@73 12 void main()
lindquist@73 13 {
lindquist@73 14 assert(u.f !<>= 0);
lindquist@94 15 {
lindquist@94 16 uint* p = 1 + cast(uint*)&u;
lindquist@94 17 {assert(*p == 0);}
lindquist@94 18 }
lindquist@73 19 }