示例#1
0
文件: test_type.py 项目: zhihan/llvm
    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)
示例#2
0
文件: test_type.py 项目: zhihan/llvm
    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)
示例#3
0
文件: test_type.py 项目: zhihan/llvm
    def testTypeCompare(self):
        a = Type.int8()
        b = Type.int8()

        self.assertEqual(a, b)

        c = Type.int32()
        self.assertTrue(c != a)
示例#4
0
文件: test_type.py 项目: zhihan/llvm
    def testTypeCompare(self):
        a = Type.int8()
        b = Type.int8()

        self.assertEqual(a, b)

        c = Type.int32()
        self.assertTrue(c != a)
示例#5
0
 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))
示例#6
0
    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))