Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
4865f11503 Update programming style. 2020-10-04 13:20:42 +11:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Mark Brown
56e818af67 Implement compare_representation/3, which is like compare except that it
Estimated hours taken: 5.5
Branches: main

Implement compare_representation/3, which is like compare except that it
is cc_multi, and it doesn't abort on non-canonical types.  The implementation
only works for the LLDS backend; in other cases, the runtime aborts with
a "sorry" message.  For this reason, it is not officially part of the
standard library yet.

library/std_util.m:
	Add the new predicate, which is implemented via "external".

runtime/mercury_ho_call.c:
	Implement compare_representation/3, and also a C version.

runtime/mercury_unify_compare_body.h:
	Implement the body of compare_representation/3.  When the macro
	include_compare_rep_code is defined comparison of preds and
	funcs doesn't abort, the code that is used for MR_COMPARE_BY_RTTI
	is enabled, and usereq types are treated as normal types.

runtime/mercury_conf_param.h:
	Document the fact that calls to compare_representation are
	counted as calls to compare for the purposes of MR_TYPE_CTOR_STATS.

runtime/Mmakefile:
	Bug fix: add missing pic_o versions of the explicit dependencies.
	Use variables for the suffixes in these dependencies.

runtime/mercury.c:
runtime/mercury.h:
	Supply a HIGHLEVEL_CODE version of the new predicate.  This just
	gives a "Sorry, not implemented" message and aborts.

tests/hard_coded/Mmakefile:
tests/hard_coded/compare_rep_usereq.exp:
tests/hard_coded/compare_rep_usereq.m:
tests/hard_coded/compare_representation.exp:
tests/hard_coded/compare_representation.m:
	Test cases.

tests/hard_coded/compare_rep_array.m:
	A test case which doesn't work yet.
2002-04-25 09:31:59 +00:00