Mercurial > projects > ldc
view tests/mini/asm3.d @ 1494:b243e28f63d4
Generate less dead code by deleting unreachable blocks at the end of functions
(which would otherwise appear if a function ends with a return, for example).
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Fri, 12 Jun 2009 16:41:38 +0200 |
parents | 4c524d80e6e1 |
children |
line wrap: on
line source
module tangotests.asm3; extern(C) int printf(char*, ...); void main() { char* fmt = "Hello D World\n"; printf(fmt); version (D_InlineAsm_X86) { asm { push fmt; call printf; pop EAX; } } else version(D_InlineAsm_X86_64) { asm { movq RDI, fmt; xor AL, AL; call printf; } } }