Advertisement
Guest User

Untitled

a guest
Oct 12th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.49 KB | None | 0 0
  1. // LDC - the LLVM D compiler (0.16.0-beta2):
  2. //  based on DMD v2.067.1 and LLVM 3.7.0
  3. //  Default target: x86_64-pc-windows-msvc
  4. //
  5. // ldc2 main.d -w -g -unittest -m64 -oq
  6.  
  7. void main(string[] args)
  8. {
  9. }
  10.  
  11. struct Foo
  12. {
  13.     union
  14.     {
  15.         struct
  16.         {
  17.             ubyte data1 = void;
  18.             ubyte data2 = void;
  19.         }
  20.         ushort data3 = 0x100;
  21.     }
  22. }
  23.  
  24. unittest
  25. {
  26.     Foo foo;
  27.     import std.stdio;
  28.     writeln(foo.data3);
  29.     assert(foo.data3 == 0x100);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement