Mercurial > lcfOS
view python/testcg.py @ 211:99164160fb0b
Added another missing file
author | Windel Bouwman |
---|---|
date | Sat, 29 Jun 2013 10:10:45 +0200 |
parents | 07bfea4c1ed7 |
children | 494828a7adf1 |
line wrap: on
line source
import unittest import ppci, codegen, ir import arm_cm3 class testCodeGeneration(unittest.TestCase): def setUp(self): self.cg = codegen.CodeGenerator(arm_cm3.armtarget) def testFunction(self): m = ir.Module('tst') f = ir.Function('tst') m.addFunction(f) bb = ir.BasicBlock('entry') f.addBasicBlock(bb) v = ir.Value('tst') bb.addInstruction(ir.ImmLoad(v, 123)) m.check() obj = self.cg.generate(m) self.assertTrue(obj) if __name__ == '__main__': unittest.main()