about summary refs log tree commit diff stats
path: root/test/arch/x86/unit/mn_cpuid.py
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2017-02-02 18:22:22 +0100
committerGitHub <noreply@github.com>2017-02-02 18:22:22 +0100
commit801edcd8c94a8572c1d3900a962d559ae9d95b85 (patch)
tree562df9dc61f6855309cb807be7da7d6a3a0ebc99 /test/arch/x86/unit/mn_cpuid.py
parentbb96e18db435760fca4ff80f012f69e656e0c699 (diff)
parent4231ba3c4783d1692227331abd24d806dfc0f805 (diff)
downloadmiasm-801edcd8c94a8572c1d3900a962d559ae9d95b85.tar.gz
miasm-801edcd8c94a8572c1d3900a962d559ae9d95b85.zip
Merge pull request #486 from commial/test/cpuid-jitters
Add regression test for CPUID support
Diffstat (limited to 'test/arch/x86/unit/mn_cpuid.py')
-rwxr-xr-xtest/arch/x86/unit/mn_cpuid.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/arch/x86/unit/mn_cpuid.py b/test/arch/x86/unit/mn_cpuid.py
new file mode 100755
index 00000000..026de207
--- /dev/null
+++ b/test/arch/x86/unit/mn_cpuid.py
@@ -0,0 +1,21 @@
+#! /usr/bin/env python2
+
+import sys
+
+from asm_test import Asm_Test_32
+
+class Test_CPUID(Asm_Test_32):
+    """Check for cpuid support (and not for arbitrary returned values)"""
+    TXT = '''
+    main:
+       XOR EAX, EAX
+       CPUID
+       RET
+    '''
+
+    def check(self):
+        assert self.myjit.cpu.EAX == 0xa
+
+
+if __name__ == "__main__":
+    [test(*sys.argv[1:])() for test in [Test_CPUID]]