Example #1
0
def test_multiply_type_set():
    """
    this example test a simple mulitply, tested with TypeSet
    """
    value = TypeSet.run(MUL_IF_LESS, number=2)

    assert_equal(value, TypeSet.const(20))
    assert_equal(value, TypeSet.INTEGER)

    value = TypeSet.run(MUL_IF_LESS, number=2.0)
    assert_equal(value, TypeSet.extremum)
Example #2
0
def llvm_const(value):
    """ """
    type_ = llvm_type(TypeSet.const(value))
    return getattr(llvmc.Constant, type_.name)(type_.internal, value)