comparison test/testzcc.py @ 335:582a1aaa3983

Added long branch format
author Windel Bouwman
date Mon, 17 Feb 2014 20:41:30 +0100
parents 6f4753202b9a
children d1ecc493384e
comparison
equal deleted inserted replaced
334:6f4753202b9a 335:582a1aaa3983
1 import unittest 1 import unittest
2 import os 2 import os
3 import sys 3 import sys
4 4
5 import zcc 5 import zcc
6 import outstream 6 from ppci.objectfile import ObjectFile
7 import ppci 7 import ppci
8 import io 8 import io
9 import target 9 import target
10 10
11 # Store testdir for safe switch back to directory: 11 # Store testdir for safe switch back to directory:
81 def testSectionAddress(self): 81 def testSectionAddress(self):
82 src = """module tst; 82 src = """module tst;
83 function void t2() {var int t3; t3 = 2;} 83 function void t2() {var int t3; t3 = 2;}
84 """ 84 """
85 f = io.StringIO(src) 85 f = io.StringIO(src)
86 outs = outstream.TextOutputStream() 86 out = ObjectFile()
87 tg = target.target_list.armtarget 87 tg = target.target_list.armtarget
88 tr = ppci.tasks.TaskRunner() 88 tr = ppci.tasks.TaskRunner()
89 tr.add_task(ppci.buildtasks.Compile([f], [], tg, outs)) 89 tr.add_task(ppci.buildtasks.Compile([f], [], tg, out))
90 tr.run_tasks() 90 tr.run_tasks()
91 code = outs.getSection('code') 91 code = out.get_section('code')
92 self.assertEqual(0x0, code.address) 92 self.assertEqual(0x0, code.address)
93 93
94 94
95 if __name__ == '__main__': 95 if __name__ == '__main__':
96 unittest.main() 96 unittest.main()