Exemplo n.º 1
0
    def test_descr(self):
        class FooDescr(AbstractDescr):
            def __repr__(self):
                return 'hi_there!'

        op = SpaceOperation('foobar', [FooDescr()], None)
        flattener = GraphFlattener(None, fake_regallocs())
        flattener.serialize_op(op)
        assert_format(flattener.ssarepr, """
            foobar hi_there!
        """)
Exemplo n.º 2
0
 def test_arg_sublist_1(self):
     v1 = varoftype(lltype.Signed)
     v2 = varoftype(lltype.Char)
     v3 = varoftype(rclass.OBJECTPTR)
     v4 = varoftype(lltype.Ptr(rstr.STR))
     v5 = varoftype(lltype.Float)
     op = SpaceOperation(
         'residual_call_ir_f',
         [
             Constant(12345, lltype.Signed),  # function ptr
             ListOfKind('int', [v1, v2]),  # int args
             ListOfKind('ref', [v3, v4])
         ],  # ref args
         v5)  # result
     flattener = GraphFlattener(None, fake_regallocs())
     flattener.serialize_op(op)
     assert_format(
         flattener.ssarepr, """
         residual_call_ir_f $12345, I[%i0, %i1], R[%r0, %r1] -> %f0
     """)