diff test/testarmasm.py @ 383:173e20a47fda

Added linker description loader
author Windel Bouwman
date Sun, 27 Apr 2014 17:40:39 +0200
parents 6df89163e114
children d056b552d3f4
line wrap: on
line diff
--- a/test/testarmasm.py	Sun Apr 27 12:24:21 2014 +0200
+++ b/test/testarmasm.py	Sun Apr 27 17:40:39 2014 +0200
@@ -1,8 +1,10 @@
 import unittest
+import io
 from ppci.outstream import BinaryOutputStream
 from ppci.objectfile import ObjectFile
 from testasm import AsmTestCaseBase
 from ppci.target.target_list import arm_target
+from ppci.layout import load_layout
 
 
 class ArmAssemblerTestCase(AsmTestCaseBase):
@@ -11,7 +13,7 @@
         self.t = arm_target
         self.obj = ObjectFile()
         self.ostream = BinaryOutputStream(self.obj)
-        self.ostream.select_section('.text')
+        self.ostream.select_section('code')
         self.assembler = arm_target.assembler
 
     def testMovImm(self):
@@ -122,7 +124,13 @@
         """ Link code at 0x10000 and check if symbol was correctly patched """
         self.feed('ldr r8, =a')
         self.feed('a:')
-        self.check('04801fe5 04000100', {'.text':0x10000})
+        spec = """
+            MEMORY flash LOCATION=0x10000 SIZE=0x10000 {
+                SECTION(code)
+            }
+        """
+        layout = load_layout(io.StringIO(spec))
+        self.check('04801fe5 04000100', layout)
 
     def testCmp(self):
         self.feed('cmp r4, r11')