comparison test/testarmasm.py @ 342:86b02c98a717 devel

Moved target directory
author Windel Bouwman
date Sat, 01 Mar 2014 15:40:31 +0100
parents 4d204f6f7d4e
children b4882ff0ed06
comparison
equal deleted inserted replaced
341:4d204f6f7d4e 342:86b02c98a717
1 import unittest 1 import unittest
2 import outstream 2 from ppci.outstream import BinaryOutputStream
3 from ppci.objectfile import ObjectFile 3 from ppci.objectfile import ObjectFile
4 from asm import Assembler 4 from asm import Assembler
5 from testasm import AsmTestCaseBase 5 from testasm import AsmTestCaseBase
6 from target.target_list import arm_target, thumb_target 6 from ppci.target.target_list import arm_target, thumb_target
7 7
8 8
9 class ThumbAssemblerTestCase(AsmTestCaseBase): 9 class ThumbAssemblerTestCase(AsmTestCaseBase):
10 def setUp(self): 10 def setUp(self):
11 self.t = thumb_target 11 self.t = thumb_target
12 self.obj = ObjectFile() 12 self.obj = ObjectFile()
13 self.o = outstream.BinaryOutputStream(self.obj) 13 self.o = BinaryOutputStream(self.obj)
14 self.o.selectSection('.text') 14 self.o.selectSection('.text')
15 self.a = Assembler(target=self.t, stream=self.o) 15 self.a = Assembler(target=self.t, stream=self.o)
16 16
17 def testMovImm8(self): 17 def testMovImm8(self):
18 self.feed('mov r4, 100') 18 self.feed('mov r4, 100')
151 class AssemblerArmTestCase(AsmTestCaseBase): 151 class AssemblerArmTestCase(AsmTestCaseBase):
152 """ ARM-mode (not thumb-mode) instruction assembly test case """ 152 """ ARM-mode (not thumb-mode) instruction assembly test case """
153 def setUp(self): 153 def setUp(self):
154 self.t = arm_target 154 self.t = arm_target
155 self.obj = ObjectFile() 155 self.obj = ObjectFile()
156 self.o = outstream.BinaryOutputStream(self.obj) 156 self.o = BinaryOutputStream(self.obj)
157 self.o.selectSection('.text') 157 self.o.selectSection('.text')
158 self.a = Assembler(target=self.t, stream=self.o) 158 self.a = Assembler(target=self.t, stream=self.o)
159 159
160 def testMovImm(self): 160 def testMovImm(self):
161 self.feed('mov r4, 100') 161 self.feed('mov r4, 100')