Mercurial > projects > ldc
view tests/mini/asm3.d @ 974:815e1b8c6b00
Allow 'return exp;' for void main().
It's unfortunate that for main the llvm type and D type don't match up...
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 17 Feb 2009 18:53:15 +0100 |
parents | 03d7c4aac654 |
children | 4c524d80e6e1 |
line wrap: on
line source
module tangotests.asm3; extern(C) int printf(char*, ...); void main() { char* fmt = "Hello D World\n"; printf(fmt); version (LLVM_InlineAsm_X86) { asm { push fmt; call printf; pop EAX; } } else version(LLVM_InlineAsm_X86_64) { asm { movq RDI, fmt; xor AL, AL; call printf; } } }