def testCreateInt32(self): ty = Type.int32(self.global_context) self.assertEqual('i32', ty.name) ty = Type.int32() self.assertEqual('i32', ty.name) context = ty.context self.assertEqual(context, self.global_context)
def testTypeCompare(self): a = Type.int8() b = Type.int8() self.assertEqual(a, b) c = Type.int32() self.assertTrue(c != a)
def testTimesTwoC(self): mod = parse_bitcode('timestwo.c') ee = ExecutionEngine.create_interpreter(mod) ty = Type.int32(context=mod.context) f = mod.get_function('timestwo') x = GenericValue.of_int(ty, 3, True) y = ee.run_function(f, [x]) self.assertEqual(6, y.to_int(True))