I figured out the bug. test.d: int foo() { asm { naked; xor EAX, EAX; ret; } } ldc2 test.d -c When looking obj file: foo named as _D4test3fooFZi If i remove "naked" then function named as __D4test3fooFZi that is correct. I'll look at naked functions declaration.