about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-12-24 17:22:50 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-12-24 18:38:19 +0100
commitc0a21589d16fba7d3b3d8233b2a595f07574ec90 (patch)
tree74103f84f15b1ff726f6b9f72e2996a7bd9178d2
parentf95a9cb25ef0c94f9b0af8952f459e346de9b5a2 (diff)
downloadmiasm-c0a21589d16fba7d3b3d8233b2a595f07574ec90.tar.gz
miasm-c0a21589d16fba7d3b3d8233b2a595f07574ec90.zip
Test: add x86 reg test
Diffstat (limited to '')
-rw-r--r--test/arch/x86/unit/mn_pextr.py25
-rw-r--r--test/test_all.py1
2 files changed, 26 insertions, 0 deletions
diff --git a/test/arch/x86/unit/mn_pextr.py b/test/arch/x86/unit/mn_pextr.py
new file mode 100644
index 00000000..eb724cf9
--- /dev/null
+++ b/test/arch/x86/unit/mn_pextr.py
@@ -0,0 +1,25 @@
+#! /usr/bin/env python
+from asm_test import Asm_Test
+import sys
+
+class Test_PEXTRB(Asm_Test):
+    TXT = '''
+    main:
+       CALL      next
+       .byte 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11
+       .byte 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01
+    next:
+       POP       EBP
+       MOV       EAX, 0xFFFFFFFF
+       MOVQ      MM0, QWORD PTR [EBP]
+       PEXTRW    EAX, MM0, 2
+       RET
+    '''
+
+    def check(self):
+        assert self.myjit.cpu.MM0 == 0x1122334455667788
+        assert self.myjit.cpu.EAX == 0x3344
+
+
+if __name__ == "__main__":
+    [test()() for test in [Test_PEXTRB]]
diff --git a/test/test_all.py b/test/test_all.py
index e161e601..70187171 100644
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -47,6 +47,7 @@ for script in ["x86/sem.py",
                "x86/unit/mn_pcmpeq.py",
                "x86/unit/mn_punpck.py",
                "x86/unit/mn_pinsr.py",
+               "x86/unit/mn_pextr.py",
                "arm/arch.py",
                "arm/sem.py",
                "aarch64/unit/mn_ubfm.py",