view tests/mini/asm3.d @ 838:94ba810ea2b0

Fixed problem with nested function inside static nested function. see mini/compile_nested2.d. fixes #143 .
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 09 Dec 2008 14:57:01 +0100
parents ef5f75ae6895
children 03d7c4aac654
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;
        }
    }

}