From 3a7e496960a296ef07a7276da44b60285fda44c4 Mon Sep 17 00:00:00 2001 From: Ingmar Steen Date: Fri, 6 May 2016 11:23:07 +0200 Subject: [PATCH] Add testcase for ldr Rd, =imm psuedo-op on ARM Refs: #28 --- suite/regress/arm_ldr_imm.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 suite/regress/arm_ldr_imm.py diff --git a/suite/regress/arm_ldr_imm.py b/suite/regress/arm_ldr_imm.py new file mode 100644 index 0000000..0d47216 --- /dev/null +++ b/suite/regress/arm_ldr_imm.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +# Ingmar Steen, 2016 + +# This tests the LDR Rd, =imm pseudo-instruction on ARM. + +# Fill in the information in the form below when you create a new regression + +# Github issue: #28 +# 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("ldr r0, =0x11223344") + # Assert the result + self.assertEqual(encoding, [ 0x04, 0x00, 0x1f, 0xe5, 0x44, 0x33, 0x22, 0x11 ]) + +if __name__ == '__main__': + regress.main()