mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
35 lines
714 B
D
35 lines
714 B
D
|
|
version (D_InlineAsm_X86)
|
|
version = TestInlineAsm;
|
|
else version (D_InlineAsm_X86_64)
|
|
version = TestInlineAsm;
|
|
else
|
|
pragma(msg, "Inline asm not supported, not testing.");
|
|
|
|
version (TestInlineAsm)
|
|
{
|
|
void testInlineAsm()
|
|
{
|
|
asm
|
|
{
|
|
L1:
|
|
nop;
|
|
nop;
|
|
nop;
|
|
nop;
|
|
|
|
mov EAX, dword ptr L1; // Check back references
|
|
mov EAX, dword ptr L2; // Check forward references
|
|
mov EAX, dword ptr DS:L1; // Not really useful in standard use, but who knows.
|
|
mov EAX, dword ptr FS:L2; // Once again, not really useful, but it is valid.
|
|
mov EAX, dword ptr CS:L1; // This is what the first test case should implicitly be.
|
|
|
|
L2:
|
|
nop;
|
|
nop;
|
|
nop;
|
|
nop;
|
|
|
|
}
|
|
}
|
|
}
|