Files
mercury/tests/hard_coded/deep_copy_exist.exp
Fergus Henderson 59250e8f20 Fix bugs with the handling of existentially typed data types
Estimated hours taken: 8
Branches: main, release

Fix bugs with the handling of existentially typed data types
in various parts of the RTTI code.

Most of these bugs were due to passing in the pointer to the secondary
tag, rather than the pointer to the first real argument (one word
past the secondary tag).

library/std_util.m:
	Fix bugs in ML_expand() and du_get_functor_info.

runtime/mercury_tabling.c:
	Fix bug in MR_table_type().

runtime/mercury_deep_copy_body.h:
	Fix bug in MR_agc_deep_copy(), the accurate GC version of deep_copy().
	Also fix another bug in the same function: when copying existentially
	typed data types, it was trying to use the type_infos in the original
	data after they had already been replaced by forwarding pointers.

compiler/polymorphism.m:
	For existentially typed data types, make sure that the
	type_infos come BEFORE the typeclass_infos, not vice versa.
	This is needed to match the code in the runtime system.
	It's also consistent with the way we order them for procedure calls.

runtime/mercury_type_info.h:
	Improve the comments a little.

tests/hard_coded/Mmakefile:
tests/hard_coded/deep_copy_exist.m:
tests/hard_coded/deep_copy_exist.exp:
	Regression tests.
2001-04-29 18:22:02 +00:00

52 lines
1.8 KiB
Plaintext

TESTING DISCRIMINATED UNIONS
apple([9, 5, 1])
apple([9, 5, 1])
apple([9, 5, 1])
banana([three, one, two])
banana([three, one, two])
banana([three, one, two])
zop(3.30000000000000, 2.03000000000000)
zop(3.30000000000000, 2.03000000000000)
zop(3.30000000000000, 2.03000000000000)
zip(3, 2)
zip(3, 2)
zip(3, 2)
zap(3, -2.11100000000000)
zap(3, -2.11100000000000)
zap(3, -2.11100000000000)
wombat
wombat
wombat
foo
foo
foo
tuple_a(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ["a", "b", "c"], 16, 17)
tuple_a(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ["a", "b", "c"], 16, 17)
tuple_a(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ["a", "b", "c"], 16, 17)
tuple_b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ["a", "b", "c"], 16, ["x", "y", "z"])
tuple_b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ["a", "b", "c"], 16, ["x", "y", "z"])
tuple_b(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ["a", "b", "c"], 16, ["x", "y", "z"])
tuple_c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ["p", "q"], 17)
tuple_c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ["p", "q"], 17)
tuple_c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ["p", "q"], 17)
tuple_d(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 'a', 15, 'z', 17)
tuple_d(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 'a', 15, 'z', 17)
tuple_d(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 'a', 15, 'z', 17)
TESTING POLYMORPHISM
poly_three(3.33000000000000, 4, poly_one(9.11000000000000))
poly_three(3.33000000000000, 4, poly_one(9.11000000000000))
poly_three(3.33000000000000, 4, poly_one(9.11000000000000))
poly_two(3)
poly_two(3)
poly_two(3)
poly_one([2399.30000000000])
poly_one([2399.30000000000])
poly_one([2399.30000000000])
TESTING BUILTINS
univ_cons(["hi! I\'m a univ!"])
univ_cons(["hi! I\'m a univ!"])
univ_cons(["hi! I\'m a univ!"])