Advertisement
Guest User

Untitled

a guest
Oct 11th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.54 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. align(16) struct some_buf
  12. {
  13. align(16):
  14.     long[32] data;
  15. }
  16.  
  17. int somefun(ref some_buf) { return 0; }
  18.  
  19. unittest
  20. {
  21.     import std.stdio;
  22.     some_buf buf;
  23.     writeln(&buf);
  24.     assert((cast(size_t)&buf & cast(size_t)0b1111) == 0);
  25.     void foo()
  26.     {
  27.         writeln("foo");
  28.         somefun(buf);
  29.     }
  30.     foo();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement