about summary refs log tree commit diff stats
path: root/test/arch/mep/jit/test_jit_branchjump.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/arch/mep/jit/test_jit_branchjump.py')
-rw-r--r--test/arch/mep/jit/test_jit_branchjump.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/arch/mep/jit/test_jit_branchjump.py b/test/arch/mep/jit/test_jit_branchjump.py
new file mode 100644
index 00000000..baf602d8
--- /dev/null
+++ b/test/arch/mep/jit/test_jit_branchjump.py
@@ -0,0 +1,23 @@
+# Toshiba MeP-c4 - Branch/Jump instructions JIT unit tests
+# Guillaume Valadon <guillaume@valadon.net>
+
+from ut_helpers_jit import jit_instructions
+
+
+class TestBranchJump:
+
+    def test_blti(self):
+        """Test BLTI jit"""
+
+        # Instructions that will be jitted
+        instructions = "MOV R0, 1\n"
+        instructions += "BLTI R0, 0x2, 0x6\n"
+        instructions += "MOV R0, 0\n"
+        instructions += "MOV R1, 1"
+
+        # Jit
+        jitter = jit_instructions(instructions)
+
+        # Check expected results
+        assert(jitter.cpu.R0 == 1)
+        assert(jitter.cpu.R1 == 1)