Mercurial > lcfOS
diff python/testir.py @ 274:ea93e0a7a31e
Move docs
author | Windel Bouwman |
---|---|
date | Wed, 04 Sep 2013 17:35:06 +0200 |
parents | e64bae57cda8 |
children | 046017431c6a |
line wrap: on
line diff
--- a/python/testir.py Mon Sep 02 17:40:21 2013 +0200 +++ b/python/testir.py Wed Sep 04 17:35:06 2013 +0200 @@ -16,8 +16,10 @@ f = self.b.newFunction('add') self.b.setFunction(f) bb = self.b.newBlock() + self.b.emit(ir.Jump(bb)) self.b.setBlock(bb) self.b.emit(ir.Exp(ir.Const(0))) + self.b.emit(ir.Jump(f.epiloog)) self.m.check() # Run interpreter: # r = self.m.getFunction('add').call(1, 2) @@ -34,11 +36,14 @@ def testBuilder(self): f = self.b.newFunction('test') self.b.setFunction(f) - self.b.setBlock(self.b.newBlock()) + bb = self.b.newBlock() + self.b.emit(ir.Jump(bb)) + self.b.setBlock(bb) v1 = ir.Const(5) v2 = ir.Const(7) v3 = ir.Add(v1, v2) - self.cf.run(self.m) + self.b.emit(ir.Jump(f.epiloog)) + #self.cf.run(self.m) def testAdd0(self): f = self.b.newFunction('test')