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

Moved target directory
author Windel Bouwman
date Sat, 01 Mar 2014 15:40:31 +0100
parents 4d204f6f7d4e
children 3bb7dcfe5529
comparison
equal deleted inserted replaced
341:4d204f6f7d4e 342:86b02c98a717
4 4
5 import zcc 5 import zcc
6 from ppci.objectfile import ObjectFile 6 from ppci.objectfile import ObjectFile
7 import ppci 7 import ppci
8 import io 8 import io
9 import target 9 from ppci.target import target_list
10 10
11 # Store testdir for safe switch back to directory: 11 # Store testdir for safe switch back to directory:
12 testdir = os.path.dirname(os.path.abspath(__file__)) 12 testdir = os.path.dirname(os.path.abspath(__file__))
13 13
14 14
100 src = """module tst; 100 src = """module tst;
101 function void t2() {var int t3; t3 = 2;} 101 function void t2() {var int t3; t3 = 2;}
102 """ 102 """
103 f = io.StringIO(src) 103 f = io.StringIO(src)
104 out = ObjectFile() 104 out = ObjectFile()
105 tg = target.target_list.armtarget 105 tg = target_list.armtarget
106 tr = ppci.tasks.TaskRunner() 106 tr = ppci.tasks.TaskRunner()
107 tr.add_task(ppci.buildtasks.Compile([f], [], tg, out)) 107 tr.add_task(ppci.buildtasks.Compile([f], [], tg, out))
108 tr.run_tasks() 108 tr.run_tasks()
109 code = out.get_section('code') 109 code = out.get_section('code')
110 self.assertEqual(0x0, code.address) 110 self.assertEqual(0x0, code.address)