Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    def testTypeCompare(self):
        a = Type.int8()
        b = Type.int8()

        self.assertEqual(a, b)

        c = Type.int32()
        self.assertTrue(c != a)
Example #4
0
    def testTypeCompare(self):
        a = Type.int8()
        b = Type.int8()

        self.assertEqual(a, b)

        c = Type.int32()
        self.assertTrue(c != a)
Example #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))
Example #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))