check imm of mov(Operand, imm)

This commit is contained in:
MITSUNARI Shigeo 2015-08-16 06:49:44 +09:00
parent 93aae57298
commit f03bbc298d
3 changed files with 22 additions and 4 deletions

View file

@ -30,5 +30,22 @@ CYBOZU_TEST_AUTO(compOperand)
CYBOZU_TEST_ASSERT(ptr[eax] == ptr[eax]);
CYBOZU_TEST_ASSERT(dword[eax] != ptr[eax]);
CYBOZU_TEST_ASSERT(ptr[eax] != ptr[eax+3]);
CYBOZU_TEST_ASSERT(ptr[eax] != ptr[eax+3]);
}
}
#ifdef XBYAK64
CYBOZU_TEST_AUTO(mov_const)
{
struct Code : Xbyak::CodeGenerator {
Code()
{
CYBOZU_TEST_NO_EXCEPTION(mov(dword[eax], -1));
CYBOZU_TEST_NO_EXCEPTION(mov(dword[eax], 0x7fffffff));
CYBOZU_TEST_NO_EXCEPTION(mov(dword[eax], -0x7fffffff));
CYBOZU_TEST_NO_EXCEPTION(mov(dword[eax], 0xabcd1234));
CYBOZU_TEST_NO_EXCEPTION(mov(dword[eax], 0xffffffff));
CYBOZU_TEST_EXCEPTION(mov(dword[eax], 0x100000000ull), Xbyak::Error);
CYBOZU_TEST_EXCEPTION(mov(dword[eax], -0x80000000ull), Xbyak::Error);
}
} code;
}
#endif