view tests/mini/asm5.d @ 946:1714836f2c0b

Mostly rewrite debug info generation in terms of llvm/Analysis/DebugInfo.h. Add getCompilationModule to Dsymbol and fix template compile unit decision code. Runtime compiles with -g again.
author Christian Kamm <kamm incasoftware de>
date Sun, 08 Feb 2009 16:50:22 +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);
}