Files
mercury/tests/hard_coded/construct_test.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

256 lines
5.7 KiB
Plaintext

TESTING DISCRIMINATED UNIONS
3 functors in this type
2 - two/0 [] ordinal: 1 lex: 2
1 - three/0 [] ordinal: 2 lex: 1
0 - one/0 [] ordinal: 0 lex: 0
3 functors in this type
2 - two/0 [] ordinal: 1 lex: 2
1 - three/0 [] ordinal: 2 lex: 1
0 - one/0 [] ordinal: 0 lex: 0
3 functors in this type
2 - two/0 [] ordinal: 1 lex: 2
1 - three/0 [] ordinal: 2 lex: 1
0 - one/0 [] ordinal: 0 lex: 0
2 functors in this type
1 - banana/1 [banana_list] ordinal: 1 lex: 1
0 - apple/1 [apple_list] ordinal: 0 lex: 0
2 functors in this type
1 - banana/1 [banana_list] ordinal: 1 lex: 1
0 - apple/1 [apple_list] ordinal: 0 lex: 0
11 functors in this type
10 - zop/2 [_, _] ordinal: 10 lex: 10
9 - zoom/1 [_] ordinal: 7 lex: 9
8 - zip/2 [_, _] ordinal: 9 lex: 8
7 - zap/2 [_, _] ordinal: 8 lex: 7
6 - wombat/0 [] ordinal: 6 lex: 6
5 - qux/1 [_] ordinal: 3 lex: 5
4 - quux/1 [_] ordinal: 4 lex: 4
3 - quuux/2 [_, _] ordinal: 5 lex: 3
2 - foo/0 [] ordinal: 0 lex: 2
1 - bar/2 [_, _] ordinal: 2 lex: 1
0 - bar/1 [_] ordinal: 1 lex: 0
11 functors in this type
10 - zop/2 [_, _] ordinal: 10 lex: 10
9 - zoom/1 [_] ordinal: 7 lex: 9
8 - zip/2 [_, _] ordinal: 9 lex: 8
7 - zap/2 [_, _] ordinal: 8 lex: 7
6 - wombat/0 [] ordinal: 6 lex: 6
5 - qux/1 [_] ordinal: 3 lex: 5
4 - quux/1 [_] ordinal: 4 lex: 4
3 - quuux/2 [_, _] ordinal: 5 lex: 3
2 - foo/0 [] ordinal: 0 lex: 2
1 - bar/2 [_, _] ordinal: 2 lex: 1
0 - bar/1 [_] ordinal: 1 lex: 0
11 functors in this type
10 - zop/2 [_, _] ordinal: 10 lex: 10
9 - zoom/1 [_] ordinal: 7 lex: 9
8 - zip/2 [_, _] ordinal: 9 lex: 8
7 - zap/2 [_, _] ordinal: 8 lex: 7
6 - wombat/0 [] ordinal: 6 lex: 6
5 - qux/1 [_] ordinal: 3 lex: 5
4 - quux/1 [_] ordinal: 4 lex: 4
3 - quuux/2 [_, _] ordinal: 5 lex: 3
2 - foo/0 [] ordinal: 0 lex: 2
1 - bar/2 [_, _] ordinal: 2 lex: 1
0 - bar/1 [_] ordinal: 1 lex: 0
11 functors in this type
10 - zop/2 [_, _] ordinal: 10 lex: 10
9 - zoom/1 [_] ordinal: 7 lex: 9
8 - zip/2 [_, _] ordinal: 9 lex: 8
7 - zap/2 [_, _] ordinal: 8 lex: 7
6 - wombat/0 [] ordinal: 6 lex: 6
5 - qux/1 [_] ordinal: 3 lex: 5
4 - quux/1 [_] ordinal: 4 lex: 4
3 - quuux/2 [_, _] ordinal: 5 lex: 3
2 - foo/0 [] ordinal: 0 lex: 2
1 - bar/2 [_, _] ordinal: 2 lex: 1
0 - bar/1 [_] ordinal: 1 lex: 0
11 functors in this type
10 - zop/2 [_, _] ordinal: 10 lex: 10
9 - zoom/1 [_] ordinal: 7 lex: 9
8 - zip/2 [_, _] ordinal: 9 lex: 8
7 - zap/2 [_, _] ordinal: 8 lex: 7
6 - wombat/0 [] ordinal: 6 lex: 6
5 - qux/1 [_] ordinal: 3 lex: 5
4 - quux/1 [_] ordinal: 4 lex: 4
3 - quuux/2 [_, _] ordinal: 5 lex: 3
2 - foo/0 [] ordinal: 0 lex: 2
1 - bar/2 [_, _] ordinal: 2 lex: 1
0 - bar/1 [_] ordinal: 1 lex: 0
TESTING POLYMORPHISM
4 functors in this type
3 - poly_two/1 [_] ordinal: 1 lex: 3
2 - poly_three/3 [_, poly3_field2, _] ordinal: 2 lex: 2
1 - poly_one/1 [_] ordinal: 0 lex: 1
0 - poly_four/2 [_, _] ordinal: 3 lex: 0
4 functors in this type
3 - poly_two/1 [_] ordinal: 1 lex: 3
2 - poly_three/3 [_, poly3_field2, _] ordinal: 2 lex: 2
1 - poly_one/1 [_] ordinal: 0 lex: 1
0 - poly_four/2 [_, _] ordinal: 3 lex: 0
4 functors in this type
3 - poly_two/1 [_] ordinal: 1 lex: 3
2 - poly_three/3 [_, poly3_field2, _] ordinal: 2 lex: 2
1 - poly_one/1 [_] ordinal: 0 lex: 1
0 - poly_four/2 [_, _] ordinal: 3 lex: 0
TESTING BUILTINS
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
no functors in this type
1 functors in this type
0 - {}/4 [_, _, _, _] ordinal: 0 lex: 0
2 functors in this type
1 - [|]/2 [_, _] ordinal: 1 lex: 1
0 - []/0 [] ordinal: 0 lex: 0
TESTING OTHER TYPES
1 functors in this type
0 - var/1 [_] ordinal: 0 lex: 0
1 functors in this type
0 - var_supply/1 [_] ordinal: 0 lex: 0
1 functors in this type
0 - var_supply/1 [_] ordinal: 0 lex: 0
4 functors in this type
3 - two/4 [_, _, _, _] ordinal: 1 lex: 3
2 - three/7 [_, _, _, _, _, _, _] ordinal: 2 lex: 2
1 - four/10 [_, _, _, _, _, _, _, _, _, _] ordinal: 3 lex: 1
0 - empty/0 [] ordinal: 0 lex: 0
1 functors in this type
0 - qwerty/1 [qwerty_field] ordinal: 0 lex: 0
1 functors in this type
0 - dummy/0 [] ordinal: 0 lex: 0
2 functors in this type
1 - unboxed_arg/1 [_] ordinal: 1 lex: 1
0 - no/0 [] ordinal: 0 lex: 0
1 functors in this type
0 - xyzzy/1 [f21name] ordinal: 0 lex: 0
About to construct three/0
Constructed: three
About to construct apple/1
Constructed: apple([1, 2, 3])
About to construct banana/1
Constructed: banana([one, two, three])
About to construct foo/0
Constructed: foo
About to construct bar/1
Constructed: bar(1)
About to construct bar/2
Constructed: bar(1, 1)
About to construct qux/1
Constructed: qux(1)
About to construct quux/1
Constructed: quux(1)
About to construct quuux/2
Constructed: quuux(1, 1)
About to construct wombat/0
Constructed: wombat
About to construct zoom/1
Constructed: zoom(1)
About to construct zap/2
Constructed: zap(1, 2.1)
About to construct zip/2
Constructed: zip(1, 1)
About to construct zop/2
Constructed: zop(2.1, 2.1)
About to construct qwerty/1
Constructed: qwerty(1)
About to construct unboxed_arg/1
Constructed: unboxed_arg(unboxed_struct(12, 34))
About to construct poly_one/1
Constructed: poly_one(1)
About to construct poly_two/1
Constructed: poly_two("goodbye")
About to construct poly_four/2
Constructed: poly_four(1, "goodbye")
About to construct {}/3
Constructed: {4, "five", '6'}
About to call construct_tuple
Constructed tuple: univ_cons({[1, 2, 3], [one, two, three], 1, 2.1})