Mercurial > projects > ldc
view test/asm1.d @ 284:70c370e97944 trunk
[svn r305] Started support for custom class allocators/deallocators. Allocators with more than one argument still need to be fixed.
Removed the LLVM stacktrace code from mars.c.
Moved the LLVM based default target detection code from mars.c to llvmhelpers.cpp.
author | lindquist |
---|---|
date | Sat, 21 Jun 2008 02:48:53 +0200 |
parents | 21f85bac0b1a |
children |
line wrap: on
line source
module asm1; extern(C) int printf(char*, ...); void main() { version(D_InlineAsm_X86) { int x; asm { mov EAX, 42; mov x, EAX; } printf("x = %d\n", x); } else version(D_InlineAsm_X86_64) { long x; asm { mov RAX, 42L; mov x, RAX; } printf("x = %ld\n", x); } else { static assert(0, "no inline asm for this platform yet"); } }