Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
bad_address.cpp
Go to the documentation of this file.
1#include <xbyak/xbyak.h>
2
3#define TEST_EXCEPTION(state) \
4{ \
5 num++; \
6 bool exception = false; \
7 try { \
8 state; \
9 } catch (...) { \
10 exception = true; \
11 } \
12 if (!exception) { \
13 printf("exception should arise for %s\n", #state); \
14 err++; \
15 } \
16}
17
20 {
21 int err = 0;
22 int num = 0;
24 TEST_EXCEPTION(mov(eax, ptr [ax])); // not support
25 TEST_EXCEPTION(mov(eax, ptr [esp * 4]));
26 TEST_EXCEPTION(mov(eax, ptr [eax * 16]));
28 TEST_EXCEPTION(mov(eax, ptr [eax * 2 + ecx * 4]));
29 TEST_EXCEPTION(mov(eax, ptr [eax * 2 + ecx * 4]));
32#ifdef XBYAK64
33 TEST_EXCEPTION(mov(eax, ptr [rax + eax]));
35#endif
36 if (!err) {
37 printf("bad_address test %d ok\n", num);
38 }
39 }
40};
41
42int main()
43{
44 Code c;
45}
int main()
#define TEST_EXCEPTION(state)
void vgatherdpd(const Xmm &x1, const Address &addr, const Xmm &x2)
Definition xbyak.h:1005
const Reg32 esp
Definition xbyak.h:2087
const Reg32 eax
Definition xbyak.h:2087
const Reg32 ecx
Definition xbyak.h:2087
void mov(const Operand &reg1, const Operand &reg2)
Definition xbyak.h:2210
const Reg16 ax
Definition xbyak.h:2088
const AddressFrame ptr
Definition xbyak.h:2090
Definition bench.cpp:18
Xbyak ; JIT assembler for x86(IA32)/x64 by C++.