view tests/mini/asm5.d @ 951:e71c61befd6d

Now that we're using LLVM 2.5, we can stop always running the CFGSimplification pass. The pass was originally added as a workaround for a LLVM 2.4 bug where debug info would reference labels that have been optimized away.
author Christian Kamm <kamm incasoftware de>
date Thu, 12 Feb 2009 18:39:03 +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);
}