view tests/mini/asm5.d @ 947:9a10fa839dc5

Switch some getModule to getCompilationModule to make sure templates are emitted in the right module.
author Christian Kamm <kamm incasoftware de>
date Sun, 08 Feb 2009 18:51:32 +0100
parents 03d7c4aac654
children b2d27ddf8f45
line wrap: on
line source

int foo()
{
    version(X86)
    asm { mov EAX, 42; }
    else static assert(0, "todo");
}

ulong bar()
{
    version(X86)
    asm { mov EAX, 0xFF; mov EDX, 0xAA; }
    else static assert(0, "todo");
}

void main()
{
    long l = 1;
    l = 2;
    l = 4;
    l = 8;
    assert(foo() == 42);
    assert(bar() == 0x000000AA000000FF);
}