Beispiel #1
0
def test_irexpr_ccall():
    callee = pyvex.IRCallee(3, "test_name", 0xFFFFFF)
    args = [ pyvex.IRExpr.RdTmp.get_instance(i) for i in range(10) ]

    m = pyvex.IRExpr.CCall("Ity_I64", callee, args)

    nose.tools.assert_equal(len(m.args), len(args))
    nose.tools.assert_equal(m.ret_type, "Ity_I64")

    for n,a in enumerate(m.args):
        nose.tools.assert_equals(a.tmp, args[n].tmp)

    m = pyvex.IRExpr.CCall(callee, "Ity_I64", ())
    nose.tools.assert_equals(len(m.args), 0)
Beispiel #2
0
def test_irexpr_ccall():
    callee = pyvex.IRCallee(3, "test_name", 1234, 0xFFFFFF)
    args = [pyvex.IRExpr.RdTmp(i) for i in range(10)]

    m = pyvex.IRExpr.CCall(callee, "Ity_I64", args)

    nose.tools.assert_equal(type(m), type(m.deepCopy()))
    nose.tools.assert_equal(len(m.args()), len(args))
    nose.tools.assert_equal(m.ret_type, "Ity_I64")
    nose.tools.assert_equal(m.callee.addr, 1234)
    nose.tools.assert_equal(m.deepCopy().callee.regparms, 3)

    for n, a in enumerate(m.args()):
        nose.tools.assert_equals(a.tmp, args[n].tmp)

    m = pyvex.IRExpr.CCall(callee, "Ity_I64", ())
    nose.tools.assert_equals(len(m.args()), 0)
Beispiel #3
0
def test_ircallee():
    callee = pyvex.IRCallee(3, "test_name", 0xFFFFFF)
    nose.tools.assert_equals(callee.name, "test_name")
    nose.tools.assert_equals(callee.regparms, 3)
    nose.tools.assert_equals(callee.mcx_mask, 0xFFFFFF)
Beispiel #4
0
 def test_ircallee(self):
     callee = pyvex.IRCallee(3, "test_name", 1234, 0xFFFFFF)
     self.assertEquals(callee.regparms, 3)
     self.assertEquals(callee.name, "test_name")
     self.assertEquals(callee.addr, 1234)
     self.assertEquals(callee.mcx_mask, 0xFFFFFF)