Skip to content
Snippets Groups Projects
Commit 9dd6aacc authored by Nguyen Anh Quynh's avatar Nguyen Anh Quynh
Browse files

Merge pull request #65 from iksteen/regress-64

Add regress test for call label on X86
parents f8902d77 2047343f
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# Ingmar Steen, 2016
# This is to test call <label> on X86.
# Github issue: #64
# Author: Ingmar Steen
from keystone import *
import regress
class TestX86Nasm(regress.RegressTest):
def runTest(self):
ks = Ks(KS_ARCH_X86, KS_MODE_32)
ks.syntax = KS_OPT_SYNTAX_NASM
encoding, count = ks.asm(b"call label; label:")
self.assertEqual(encoding, [ 0xe8, 0x00, 0x00, 0x00, 0x00 ])
class TestX86Intel(regress.RegressTest):
def runTest(self):
ks = Ks(KS_ARCH_X86, KS_MODE_32)
ks.syntax = KS_OPT_SYNTAX_INTEL
encoding, count = ks.asm(b"call label; label:")
self.assertEqual(encoding, [ 0xe8, 0x00, 0x00, 0x00, 0x00 ])
class TestX86Att(regress.RegressTest):
def runTest(self):
ks = Ks(KS_ARCH_X86, KS_MODE_32)
ks.syntax = KS_OPT_SYNTAX_ATT
encoding, count = ks.asm(b"call label; label:")
self.assertEqual(encoding, [ 0xe8, 0x00, 0x00, 0x00, 0x00 ])
if __name__ == '__main__':
regress.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment