Skip to content
Snippets Groups Projects
Commit c0dfddf0 authored by Ingmar Steen's avatar Ingmar Steen
Browse files

Add test for ldr Rd, =label on ARM.

Currently, =label is interpreted as a string instead of a symbol.
parent 2f6f1176
Branches
Tags
No related merge requests found
#!/usr/bin/python
# Ingmar Steen, 2016
# This tests the LDR Rd, =label pseudo-instruction on ARM.
# Fill in the information in the form below when you create a new regression
# Github issue: #46
# Author: Ingmar Steen
from keystone import *
import regress
class TestARM(regress.RegressTest):
def runTest(self):
# Initialize Keystone engine
ks = Ks(KS_ARCH_ARM, KS_MODE_ARM)
# Assemble to get back insn encoding & statement count
encoding, count = ks.asm(b"ldr r0, =data; data:")
# Assert the result
self.assertEqual(encoding, [ 0x04, 0x00, 0x1f, 0xe5, 0x04, 0x00, 0x00, 0x00 ])
if __name__ == '__main__':
regress.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment