about summary refs log tree commit diff stats
path: root/test/arch/mep/jit/test_jit_branchjump.py
blob: 1f932aa9a0eba87457759dc055623e497d561ec1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Toshiba MeP-c4 - Branch/Jump instructions JIT unit tests
# Guillaume Valadon <guillaume@valadon.net>

from ut_helpers_jit import jit_instructions


class TestBranchJump(object):

    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)