diff options
| -rw-r--r-- | test/jitter/jitcore.py | 40 | ||||
| -rwxr-xr-x | test/test_all.py | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/jitter/jitcore.py b/test/jitter/jitcore.py new file mode 100644 index 00000000..af697e49 --- /dev/null +++ b/test/jitter/jitcore.py @@ -0,0 +1,40 @@ +import sys + +from miasm.analysis.machine import Machine +machine = Machine("x86_64") +jitter = machine.jitter(sys.argv[1]) + +jitter.cpu.RAX = 16565615892967251934 +assert jitter.cpu.RAX == 16565615892967251934 + +jitter.cpu.RAX = -1 +assert jitter.cpu.RAX == 0xffffffffffffffff + +jitter.cpu.RAX = -2 +assert jitter.cpu.RAX == 0xfffffffffffffffe + +jitter.cpu.EAX = -2 +assert jitter.cpu.EAX == 0xfffffffe + +jitter.cpu.RAX = -0xffffffffffffffff +assert jitter.cpu.RAX == 1 + +try: + jitter.cpu.RAX = 0x1ffffffffffffffff +except TypeError as te: + pass +else: + raise Exception("Should see that 0x1ffffffffffffffff is to big for RAX") + +jitter.cpu.EAX = -0xefffffff +assert jitter.cpu.EAX == 0x10000001 + +jitter.cpu.EAX = -0xFFFFFFFF +assert jitter.cpu.EAX == 1 + +try: + jitter.cpu.EAX = -0x1ffffffff +except TypeError as te: + pass +else: + raise Exception("Should see that -0x1ffffffff is to big for EAX") diff --git a/test/test_all.py b/test/test_all.py index a8a0d599..6d4ee0a5 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -457,6 +457,7 @@ for i, test_args in enumerate(test_args): for script in ["jitload.py", "vm_mngr.py", "jit_options.py", + "jitcore.py", "test_post_instr.py", "bad_block.py", "jmp_out_mem.py", |