Files
mercury/tests/hard_coded/integer_int64_conv.exp
Julien Fischer f80463dbcb Add builtin 64-bit integer types -- Part 2.
Replace placeholder types with int64 and uint64 as appropriate throughout the
system.

Enable support for 64-bit integer literals in the compiler.

Add initial library support for 64-bit integers.

configure.ac:
     Check that the bootstrap compiler recognises int64 and uint64 as
     builtins.

library/int64.m:
library/uint64.m:
     Populate these two modules to the extent that we can now run
     basic tests of 64-bit integer support.

     Note that since the bootstrap compiler will not recognise
     64-bit integer literals, any such literals are current written
     as conversions from ints; this will be replaced once this change
     has bootstrapped.

library/private_builtin.m:
    Replace the placeholder definitions for builtin unification and
    comparison of 64-bit integers with their actual definitions.

library/integer.m:
    Add procedures for converting integers to- and from int64 and uint64.

library/string.m:
    Add functions for converting 64-bit integers into strings.

library/io.m:
    Add predicates for writing 64-bit integers to text streams.
    (Support for 64-bit integers with binary streams will be done
    separately.)

library/stream.string_writer.m:
    Add put_int64/4 and put_uint/64.

    Extend the implementations of print and write to cover int64 and
    uint64.

library/pprint.m:
    Make int64 and uint64 instances of the doc/1 type class.

library/erlang_rtti_implementation.m:
library/rtti_implementation.m:
    Handle int64 and uint64 properly in deconstruct.

library/term.m:
    Add functions for converting 64-bit integers into terms.

library/term_conversion.m:
    Support int64 and uint64 in univ -> term conversion.

library/Mercury.options:
    Avoid a warning about the import of the require being
    unused in the int64 and uint64 modules.  It *is* used,
    but only in the definitions used by the Erlang backend.

compiler/superhomogeneous.m:
     Accept 64-bit integer literals.

compiler/c_util.m:
     In C, write out the value of the min_int64 as the symbolic
     constant INT64_MIN.  This expands in such a way as to avoid
     generating warnings from the C compiler.

compiler/builtin_ops.m:
compiler/bytecode.m:
compiler/elds.m:
compiler/elds_to_erlang.m:
compiler/hlds_data.m:
compiler/hlds_out_util.m:
compiler/llds.m:
compiler/llds_out_data.m:
compiler/lookup_switch.m:
compiler/mercury_to_mercury.m:
compiler/mlds.m:
compiler/mlds_to_cs.m:
compiler/mlds_to_java.m:
compiler/opt_debug.m:
compiler/parse_tree_out_info.m:
compiler/parse_tree_to_term.m:
compiler/prog_data.m:
compiler/prog_out.m:
compiler/prog_rep.m:
     Replace the use of int as a placeholder with int64 or uint64 as
     appropriate.

tests/hard_coded/Mmakefile:
tests/hard_coded/arith_int64.{m,exp}:
tests/hard_coded/arith_uint64.{m,exp}:
tests/hard_coded/bitwise_int64.{m,exp}:
tests/hard_coded/bitwise_uint64.{m,exp}:
tests/hard_coded/cmp_int64.{m,exp}:
tests/hard_coded/cmp_uint64.{m,exp}:
tests/hard_coded/integer_int64_conv.{m,exp}:
tests/hard_coded/integer_uint64_conv.{m,exp}:
     Add tests of basic operations on 64-bit integers.

tests/hard_coded/construct_test.{m,exp}:
    Extend this test to cover 64-bit integers.
2018-02-02 10:33:25 -05:00

53 lines
1.7 KiB
Plaintext

*** Testing int64 -> integer conversion ***
int64 = -9223372036854775808, integer = -9223372036854775808
int64 = -2147483648, integer = -2147483648
int64 = -32768, integer = -32768
int64 = -128, integer = -128
int64 = -64, integer = -64
int64 = -32, integer = -32
int64 = -1, integer = -1
int64 = 0, integer = 0
int64 = 1, integer = 1
int64 = 2, integer = 2
int64 = 4, integer = 4
int64 = 8, integer = 8
int64 = 10, integer = 10
int64 = 16, integer = 16
int64 = 32, integer = 32
int64 = 64, integer = 64
int64 = 127, integer = 127
int64 = 16383, integer = 16383
int64 = 16384, integer = 16384
int64 = 16385, integer = 16385
int64 = 32767, integer = 32767
int64 = 2147483647, integer = 2147483647
int64 = 9223372036854775807, integer = 9223372036854775807
*** Testing integer -> int64 conversion ***
integer = -9223372036854775808, int64 = -9223372036854775808
integer = -4294967296, int64 = -4294967296
integer = -2147483649, int64 = -2147483649
integer = -2147483648, int64 = -2147483648
integer = -32768, int64 = -32768
integer = -2, int64 = -2
integer = -1, int64 = -1
integer = 0, int64 = 0
integer = 1, int64 = 1
integer = 2, int64 = 2
integer = 16383, int64 = 16383
integer = 16384, int64 = 16384
integer = 16385, int64 = 16385
integer = 32767, int64 = 32767
integer = 1073741824, int64 = 1073741824
integer = 2147483647, int64 = 2147483647
integer = 2147483648, int64 = 2147483648
integer = 4294967295, int64 = 4294967295
integer = 4294967296, int64 = 4294967296
integer = 4294967297, int64 = 4294967297
integer = 9223372036854775807, int64 = 9223372036854775807
integer = 9223372036854775808, int64 = <<OUT-OF-RANGE>>
integer = 18446744073709551615, int64 = <<OUT-OF-RANGE>>
integer = 18446744073709551616, int64 = <<OUT-OF-RANGE>>