Commit Graph

26 Commits

Author SHA1 Message Date
Zoltan Somogyi
be3f9443b1 Simplify the setup of mdbrc for tests.
We used to set up *two* mdbrc files for use by test cases:
scripts/test_mdbrc, and tests/mdbrc. Tools/bootcheck said
the tests should use the former, while tests/Mmake.common
said they should use the latter. This diff deletes the latter,
and uniformly uses the former.

The setup code was also scattered, with parts being done by
the configure script, and part being done by tools/bootcheck.
Move it all to scripts/Mmakefile, since that is the natural
place to put code to build scripts/test_mdbrc.

Mmakefile:
    Fix the action for cleaning up the tests directory.
    This started out as the reason for this whole change.
    As it happens, a *working* action for cleaning up the tests
    broke things, because it deleted an autoconfigured file
    (tests/mdbrc) that there was no rule for rebuilding.
    This issue is what required the rest of this diff.

    When doing "mmake clean/realclean", clean the extras as well.

configure.ac:
    Delete the code creating tests/mdbrc.in.

scripts/Mmakefile:
    Add a rule to build test_mdbrc, as mentioned above.

tests/Mmake.common:
    Switch to using scripts/test_mdbrc in test cases
    run under mdb.

    Mark the rules that clean up mdbrc and mdbrc.in
    as obsolete, since we will now stop creating those files.

tools/bootcheck:
    Delete the code that used to build tests/mdbrc. Instead,
    rebuild scripts/test_mdbrc (in case the workspace was moved),
    and use that.

tests/Mmakefile:
    When cleaning the tests directory, clean its subdirectories
    (since the top level directory does not have much clean).
2020-10-04 23:00:29 +11:00
Zoltan Somogyi
ac50b3cbd1 Do not use exceptions in options_file.m.
And add tests for how the compiler handles both valid and invalid
options files.

compiler/options_file.m:
    This diff rewrites options_file.m in a straightforward, direct style that
    returns indications of errors as error_specs rather than as exceptions.
    A recent diff started on this task; this diff finishes it.

    The new approach has several advantages.

    - The control flow is much simpler, and therefore more understandable.
      Correctness arguments for propositions such as "this code closes
      all the file streams that it opens" are now much simpler to make.

    - We now report errors using error_specs, which contain context
      information, while previously, each error was described only
      by a string, without context info.

    - Once we detect and report one error, we can continue to read the
      rest of the input. This allows a single compiler invocation to find
      and report several errors, not just the first.

    - Since we now return the gathered set of error_specs instead of printing
      them, the predicates of this file don't have to take globals structures
      as arguments, which allows our callers to avoid constructing those
      structures.

    - Deep profiling, which cannot handle exceptions, now works on
      the code of this module.

    Change over to using trace goals for debugging prints, since continuing
    to use debug_make_msg would require a globals structure.

    Add an XXX on a likely bug.

    Add a mechanism for writing out a database of variable names and values.

compiler/mercury_compile_main.m:
    Conform to the changes in options_file.m. Document where exactly
    we could avoid constructing a globals just for options_file.m.

    If the right option is given, get options_file to write out the database
    of variable names and values it has just read in, to enable the
    functionality of this module to be tested.

compiler/options.m:
doc/user_guide.texi:
    Add a new developer option, --dump-options-file, to control the above.

compiler/make.build.m:
compiler/make.m:
compiler/make.program_target.m:
    Conform to the changes in options_file.m.

compiler/file_util.m:
    Fix an error message.

tests/Mmakefile:
tools/bootcheck:
    List options_file and invalid_options_file as two new test directories.

    Fix a command in bootcheck.

tests/options_file/Mmakefile:
    Add a mechanism for testing whether options_file.m builds mapping
    from make variable names to values that we expect.

tests/Mmake.common:
    Provide a mechanism for comparing dumped options_files against
    their expected contents, for use by tests/invalid_options_file/Mmakefile.

    Fix a comment.

tests/options_file/basic_test.m:
tests/options_file/basic_test.optfile_exp:
tests/options_file/basic_test.options_file:
tests/options_file/basic_test.options_file.sub0:
tests/options_file/basic_test.options_file.sub1:
    A simple test case for exercising all the usual options_file constructs.

tests/invalid_options_file/Mmakefile:
    Add a mechanism for testing whether options_file.m generates
    the error messages we expect for various kinds of errors in options files.

tests/invalid_options_file/no_assign.{m,options_file,err_exp}:
tests/invalid_options_file/no_var.{m,options_file,err_exp}:
tests/invalid_options_file/nonexistent_file.{m,options_file,err_exp}:
tests/invalid_options_file/undefined_var.{m,options_file,err_exp}:
tests/invalid_options_file/unterminated_string.{m,options_file,err_exp}:
tests/invalid_options_file/unterminated_var.{m,options_file,err_exp}:
    Six test cases to test six different kinds of errors that can be
    detected by options_file.m.
2020-06-12 04:14:00 +10:00
Zoltan Somogyi
1f45f91886 Make "mmake runtests" work again.
My commit afe2887882 broke the ability
to run the test suite outside of a bootcheck by executing "mmake runtests"
in the tests directory. This diff fixes that.

tests/Mmake.common:
    Don't define "TESTS_DIR = ..". While every single tests/*/Mmakefile
    defined it as such, I overlooked the fact that tests/Mmakefile itself
    defined it ".", referring to the same directory from a different starting
    point. Document this easily-overlooked fact.

    Rename the old runtests target, which after afe2887 runs the tests
    in a single directory, as runtests_dir, to leave the target name
    "runtests" itself free for tests/Mmakefile to use.

tests/Mmakefile:
    Define "TESTS_DIR = .", and add a target "runtests" which invokes
    "mmake runtests_dir" in each test directory.

tools/bootcheck:
    Invoke "mmake runtests_dir" instead of "mmake runtests" in each
    test directory.

    Initialize a variable just before it is used.

tests/*/Mmakefile:
    Add back the definition "TESTS_DIR = .."
2020-06-10 01:05:15 +10:00
Zoltan Somogyi
afe2887882 Remove stale references to test subdirs.
A long time ago, test directories such as hard_coded had subdirectories
such as hard_coded/typeclasses. These have since been flattened out
(e.g. hard_coded/typeclasses is now just typeclasses), but there were
still remnants of the old approach. This diff deletes those remnants.

tests/*/Mmakefile:
    Delete the TESTS_DIR and the SUBDIRS mmake variables; TESTS_DIR
    was always set to "..", and SUBDIRS to the empty string.

    Delete any references to the make variable NOT_WORKING, since
    it is never used.

tests/Mmake.common:
    Document that Mmakefiles in test directories don't have to set
    TESTS_DIR and SUBDIRS anymore. Fix the formatting of the documentation
    of the make variables they do still have to set.

    Delete the targets and actions for handling subdirectories of
    test directories, since there aren't any.

tests/Mmakefile:
    Simplify some code.
2020-04-14 11:23:12 +10:00
Zoltan Somogyi
aea3b98033 Test the process of making .int files.
tests/Mmakefile:
tools/bootcheck:
    Add invalid_make_int and valid_make_int as new test directories.

tests/invalid_make_int/missing_interface_import.m:
tests/invalid_make_int/missing_interface_import.int_err_exp:
tests/invalid_make_int/missing_interface_import.int_err_exp2:
    Move this test case from invalid to invalid_make_int, since it was
    *already* testing the error message we get from "mmc --make-interface".

tests/invalid_make_int/Mercury.options:
tests/invalid_make_int/Mmakefile:
    Set up testing of whether we get the right error messages during
    the process of making .int files.

tests/Mmake.common:
    Provide a way for tests in invalid_make_int to compare a .int_err file
    against several .int_err_exp* files.

tests/invalid/Mercury.options:
tests/invalid/Mmakefile:
    Delete references to the test case moved to invalid_make_int.

tests/valid_make_int/bug499.m:
    Add the test case that motivated this change.

tests/valid_make_int/Mercury.options:
tests/valid_make_int/Mmakefile:
    Set up testing of whether we can generate .int files for modules.
2020-04-13 04:14:51 +10:00
Zoltan Somogyi
bd7d7db57d Move nested-module programs from invalid to invalid_submodules.
This is to compile them with "mmake -j1", and thus avoid the intermittent
failures caused by interface files of nested submodules not being ready
when another job, executed in parallel by mmake, wants to read them.

tests/invalid_submodules/children.m:
tests/invalid_submodules/children2.m:
tests/invalid_submodules/duplicate_module.m:
tests/invalid_submodules/duplicate_module_test.err_exp:
tests/invalid_submodules/duplicate_module_test.m:
tests/invalid_submodules/exported_unify3.err_exp:
tests/invalid_submodules/exported_unify3.err_exp2:
tests/invalid_submodules/exported_unify3.m:
tests/invalid_submodules/func_class.err_exp:
tests/invalid_submodules/func_class.m:
tests/invalid_submodules/import_in_parent.err_exp:
tests/invalid_submodules/import_in_parent.m:
tests/invalid_submodules/missing_parent_import.err_exp:
tests/invalid_submodules/missing_parent_import.m:
tests/invalid_submodules/nested_impl_in_int.err_exp:
tests/invalid_submodules/nested_impl_in_int.m:
tests/invalid_submodules/sub_a.m:
tests/invalid_submodules/sub_c.err_exp:
tests/invalid_submodules/sub_c.m:
tests/invalid_submodules/undef_mod_qual.err_exp:
tests/invalid_submodules/undef_mod_qual.m:
tests/invalid_submodules/unresolved_overloading.err_exp:
tests/invalid_submodules/unresolved_overloading.m:
    Move these files, which contain the source code and expected outputs
    of the affected test cases, from the invalid directory to the new
    invalid_submodules directory.

tests/invalid/Mercury.options:
tests/invalid/Mmakefile:
    Delete any mentions of the moved test cases.

    Improve sh programming style in actions.

tests/invalid_submodules/Mercury.options:
tests/invalid_submodules/Mmakefile:
    List *only* the moved test cases. Specify the -j1 flag for mmake.

tests/Mmakefile:
tools/bootcheck:
    Mention the new test directory.

    Request that the list of test directories in these two places be kept
    in sync.

    Note that the feedback test directory is not yet ready.
2019-08-14 23:28:00 +10:00
Zoltan Somogyi
e0cdfc2fe2 Make the tests really work in parallel.
There was a bug that prevented the tests in each directory from being run
in parallel, even when the mmake was invoked with e.g. -j4. The bug
was the absence of a '+' on an action that invoked tests/run_one_test.
Without that +, the make process inside the "mmake -j4 runtests_local"
command issued by bootcheck screwed up its connection with the recursive
make invoked by run_one_test, and apparently decided to stop using
parallelism. It was telling us this all this time but its messages,
which looked like this:

    make[2]: warning: -jN forced in submake: disabling jobserver mode.

were lost in the sea of other bootcheck output until my recent change
to run_one_test.

A single-character change fixes the bug; the rest of this big change is
dealing with the consequences of fixing the bug. Many test cases in
the hard_coded and valid directories contain nested modules, which
need to be compiled sequentially.

tests/Mmake.common:
    Fix the bug.

    Delete the duplicate "ALL TESTS SUCCEEDED" message from the runtests
    target, since the runtests_local target already prints a message
    to that effect. Make this message more emphatic.

tests/run_one_test:
    Make the output a bit easier to understand.

tests/hard_coded/*.{m,exp}:
tests/submodules/*.{m,exp}:
    Move the source files and expected output files of the test cases that
    use nested modules from hard_coded to submodules, since most of the tests
    in the hard_coded can be done in parallel, while the ones in submodules
    are already done in sequence.

tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
tests/submodules/Mmakefile:
tests/submodules/Mercury.options:
    Move the Mmakefile and Mercury.options entries of the moved test cases
    from hard_coded to submodules.

tests/valid_seq:
    A new test directory, to hold the test cases originally in tests/valid
    that contain nested modules. Moving these to a new directory, which
    forces -j1, allows us to execute the remaining ones in parallel.

tests/valid/*.m:
tests/valid_seq/*.m:
    Move the source files of the test cases that use nested modules
    from valid to valid_seq.

    In a few cases, clean up the test cases a bit.

tests/valid/Mmakefile:
tests/valid/Mercury.options:
tests/valid_seq/Mmakefile:
tests/valid_seq/Mercury.options:
tests/valid/Mmake.valid.common:
    Add valid_seq/Mmakefile to list the test cases now in valid_seq,
    and add valid_seq/Mercury.options to hold their option values.
    Delete the entries of those tests from valid/Mmakefile, and their option
    values from valid/Mercury.options. Unlike valid/Mmakefile,
    valid_seq/Mmakefile forces -j1.

    To avoid unnecessary duplication between the two Makefiles, put
    all the rules that both need into valid/Mmake.valid.common, and
    include this in both Mmakefiles.

tests/string_format/Mmakefile:
    Force -j1, since these tests share a library module.

tests/Mmakefile:
    List the new valid_seq directory among the others.

tests/bootcheck:
    Execute the tests in the new valid_seq directory as well as the others.

    Record when the execution of the test suite is started.

    Comment out invocations of set -x, since they add no useful information
    in the vast majority of cases. The comment sign can be removed if and
    when the information *would* be useful.

    Don't try to copy a nonexistent file. (The error message about this
    was also lost in the noise.)
2015-08-26 01:01:54 +10:00
Zoltan Somogyi
79b9d33cbd Fix the structure_reuse tests.
tests/Mmakefile:
    List structure_reuse as one of the test directories.

tests/structure_reuse/Mmakefile:
    Fix some bit rot that was allowed to accumulate because tests in
    this directory weren't enabled: refer to options by their current names.

tests/structure_reuse/internal_alias.exp:
    Fix some bit rot that was allowed to accumulate because tests in
    this directory weren't enabled: expect the current format for floats.

tests/structure_reuse/Mercury.options:
    Delete a reference to an option that never existed, at least in the
    repository (it may have existed in one of Nancy's workspaces.
2015-02-10 02:47:46 +11:00
Zoltan Somogyi
de2f7b2a0c Flatten the test directories, step 2.
Specifically, rename the following subdirectories of the test directory:

    old dir name                new dir name

    analysis/ext                analysis_external
    analysis/ctgc               analysis_ctgc
    analysis/excp               analysis_excp
    analysis/table              analysis_table
    analysis/trail              analysis_trail
    invalid/purity              invalid_purity
    analysis/sharing            analysis_sharing
    hard_coded/purity           purity
    general/accumulator         accumulator
    analysis/unused_args        analysis_unused_args
    debugger/declarative        declarative_debugger
    hard_coded/exceptions       exceptions
    general/string_format       string_format
    hard_coded/sub-modules      submodules
    hard_coded/typeclasses      typeclasses
    general/structure_reuse     structure_reuse

Some subdirectories are still there, to wit, the subdirs of the inactive
test directory stm, each of which (if I remember correctly) holds only one
test case.

The general/structure_reuse directory previously wasn't enabled; I think
this was a bug.

tests/Mmakefile:
tools/bootcheck:
    List the new test directories.

tests/Mmake.common:
    The analysis_* directories each need to know whether the workspace
    uses subdirs. This used to be controlled from one place,
    analysis/Mmakefile, but since analysis_* are not subdirs of analysis,
    we need a new central place to find this out.

tests/analysis/common.sh:
    Update documentation for the move.

tests/OLDDIRS/Mmakefile:
    Set the subdir list to empty.

tests/NEWDIRS/Mmakefile:
    Update the "this" directory's name, as well as TESTS_DIR.

    In analysis_*/Mmakefile, use the new mechanism for detecting the presence
    of subdirs.
2015-02-10 00:44:14 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Paul Bone
7f39309eb2 Create test cases for feedback analysis.
These test cases take a program's profile and compute from it a feedback file.
Then pretty-print the feedback file using mdprof_report_feedback, and compare
the pretty-printed output to a reference output.  By comparing the pretty
printed output it's easy to see what has changed when the tests fail.

tests/Mmakefile:
tests/feedback:
    Create feedback directory in the test suite.

tests/feedback/Mmakefile:
tests/feedback/autopar_mandelbrot.exp:
tests/feedback/autopar_mmc.exp:
tests/feedback/mandelbrot/Deep.data:
tests/feedback/mandelbrot/Deep.procrep:
tests/feedback/mmc/Deep.data:
tests/feedback/mmc/Deep.procrep:
    Create two test cases for feedback analysis, these test the automatic
    parallelization of the compiler and mandelbrot program.

deep_profiler/mdprof_create_feedback.m:
    The create feedback tool does not generate a report by default.
2011-12-05 05:58:07 +00:00
Peter Wang
6eab527191 More changes to the intermodule analysis framework.
Branches: main

More changes to the intermodule analysis framework.  This patch mainly deals
with incorrect treatment of :- external procedures, opt_imported procedures,
and forcing the correct reanalyses when answers change or requests are
satisfied.

- Previously, the way to ensure that a module M is reanalysed if a request in
  module N is satisfied was, while analysing M: assume an answer for the
  procedure in N; record that as a result in N; and record that M has a
  dependency on that answer.  When N is analysed, if the real answer is
  better than the assumed answer, M would be marked `suboptimal' and later
  reanalysed.

  That's complicated and wasn't always done correctly.  Now we remember the
  module which makes a request.  When the request is satisfied, we mark the
  requesting module as `suboptimal'.  This also means the `.analysis' file of
  a module will only be modified when analysing that module and no others,
  which should be useful for parallel builds.

- In most analyses we weren't recording results for exported `:- external'
  procedures as we don't have their clauses and don't analyse them.  Other
  modules would happily make requests for `:- external' procedures, which
  would never be satisfied.

- We shouldn't make intermodule requests for `opt_imported' procedures as we
  actually have their clauses.  Even if the request is satisfied, we'd
  probably not look them up since we do have their clauses.

- If a module M opt_imports a procedure P from module N (its clauses are
  available while analysing M) then M also needs to depend on any answers
  required by P.  Otherwise a change to an answer required by P won't cause M
  to be reanalysed.

- There doesn't seem to be any reason to keep track of the analysis status of
  individual results.  If an answer changes requiring another module to be
  reanalysed, the *whole module* will be marked suboptimal or invalid.  And
  if that results in changed answers, its dependant modules will be marked.
  This patch doesn't remove the status of individual results but makes them
  always `optimal'.


compiler/analysis.m:
	Remember the name of the module being analysed in the analysis_info.
	Simplify some predicate interfaces with this information.

	Remember whether we're currently making an analysis file or just
	reading from them.  Make the record_* predicates do nothing in the
	latter case, so the caller doesn't need to check.  Also make the
	record predicates do the right thing if the callee module is
	non-local, e.g.  don't make requests to non-local modules.

	Automatically add a request if depending on a result that doesn't
	exist.

	Add a procedure to return the existing call patterns for a procedure,
	regardless of whether the module has been marked `invalid'.

	Add some assertions to check the analysis framework is being used as
	intended.

	Minor cleanups.

compiler/analysis.file.m:
	Record the module that made the request in `.request' files.

	Bump the analysis file version number.

compiler/hlds_module.m:
	Pass extra arguments to `init_analysis_info'.

compiler/hlds_pred.m:
	Add `pred_info_is_imported_not_external' which doesn't succeed on
	`:- external' procedures (defined in the current module), unlike
	`pred_info_is_imported'.

compiler/exception_analysis.m:
compiler/tabling_analysis.m:
compiler/trailing_analysis.m:
compiler/unused_args.m:
	Record results for `:- external' procedures.

	Don't look up results for our own `:- external' procedures from the
	analysis registry.  In general, fix many spots where external procs
	would be treated as imported.

	Write out results for procedures which are exported to submodules.

	Conform to analysis framework changes.  Remove some redundant checks
	which have been moved into the framework.

compiler/mercury_compile.m:
	Conform to analysis framework changes.

compiler/structure_reuse.analysis.m:
	Be careful not to read in requests and call patterns for
	`opt_imported' procedures as if they were defined in the current
	module.

	If depending on an answer that doesn't exist, also make a request for
	that answer.

	Conform to analysis framework changes.

	Write out messages when removing useless reuse version procedures.

compiler/structure_reuse.indirect.m:
	Use `pred_info_is_imported_not_external' so as not to look up results
	for our own `:- external' procedures from the analysis registry.

	Treat `opt_imported' procedures as intra-module as far as requests
	are concerned.  We need to satisfy requests for them in the current
	compiler invocation rather than when analysing imported modules.

compiler/structure_sharing.analysis.m:
	Fix treatment of `:- external' procedures.

	Conform to analysis framework changes.

compiler/structure_sharing.domain.m:
	Don't return suboptimal when unable to look up a result.

compiler/mmc_analysis.m:
	Replace pred_or_func_name_arity_to_func_id by a higher-level
	predicate.

tests/Mmakefile:
tests/analysis/Mmakefile:
tests/analysis/common.sh:
tests/analysis/excp/Mercury.options:
tests/analysis/excp/Mmakefile:
tests/analysis/excp/excp_m1.m.exception:
tests/analysis/excp/excp_m1.m.no_exception:
tests/analysis/excp/excp_m2.m:
tests/analysis/excp/excp_m3.m:
tests/analysis/excp/excp_runtest.sh:
tests/analysis/ext/Mercury.options:
tests/analysis/ext/Mmakefile:
tests/analysis/ext/ext.m:
tests/analysis/ext/ext2.m:
tests/analysis/ext/ext2_runtest.sh:
tests/analysis/ext/ext_runtest.sh:
tests/analysis/sharing/Mercury.options:
tests/analysis/sharing/Mmakefile:
tests/analysis/sharing/sharing_m1.m.no_share:
tests/analysis/sharing/sharing_m1.m.share:
tests/analysis/sharing/sharing_m2.m:
tests/analysis/sharing/sharing_m3.m:
tests/analysis/sharing/sharing_runtest.sh:
tests/analysis/table/Mercury.options:
tests/analysis/table/Mmakefile:
tests/analysis/table/table_m1.m.no_tabling:
tests/analysis/table/table_m1.m.tabling:
tests/analysis/table/table_m2.m:
tests/analysis/table/table_m3.m:
tests/analysis/table/table_runtest.sh:
tests/analysis/trail/Mercury.options:
tests/analysis/trail/Mmakefile:
tests/analysis/trail/trail_m1.m.no_trail:
tests/analysis/trail/trail_m1.m.trail:
tests/analysis/trail/trail_m2.m:
tests/analysis/trail/trail_m3.m:
tests/analysis/trail/trail_runtest.sh:
tests/analysis/unused_args/Mercury.options:
tests/analysis/unused_args/Mmakefile:
tests/analysis/unused_args/ua_m1.m.no_unused_args:
tests/analysis/unused_args/ua_m1.m.unused_args:
tests/analysis/unused_args/ua_m2.m:
tests/analysis/unused_args/ua_m3.m:
tests/analysis/unused_args/unused_args_runtest.sh:
	Add test cases.
2008-06-05 06:25:20 +00:00
Peter Wang
257dcf24ca This patch adds preliminary support for deterministic, dependent
Estimated hours taken: 50
Branches: main

This patch adds preliminary support for deterministic, dependent
parallel conjunctions to the low-level backend.  In other backends
dependent parallel conjunctions are converted into plain conjunctions.

For a parallel conjunction (A & B), if the goal B is dependent on a variable
X which is bound by goal A, we transform the conjunction such that
goal B must wait for the value to be produced by A before it begins
executing.  This transformation is not yet useful in practice (you might as
well use a sequential conjunction).  A later version of this transformation
will move the synchronisation deeper into the goals so that B can execute as
much as possible before it waits for the value from A.

There is no coroutining support yet so if there are not enough threads
available then dependent parallel conjunctions can cause the program to
deadlock.


configure.in:
runtime/mercury_conf.h.in:
	Check for existence of semaphore.h and #define MR_HAVE_SEMAPHORE_H
	if it does.

library/library.m:
library/par_builtin.m:
library/private_builtin.m:
mdbcomp/prim_data.m:
mdbcomp/program_representation.m:
	Add a new module `par_builtin' to hold synchronisation primitives.

compiler/modules.m:
	Import `par_builtin' module in parallel grades.

compiler/dep_par_conj.m:
compiler/transform_hlds.m:
compiler/mercury_compile.m:
	Add a transformation to detect dependent parallel conjunctions
	and insert the necessary synchronisation code.

compiler/hlds_goal.m:
	Consider empty parallel conjunctions as atomic, the same as plain
	conjunctions.

compiler/inlining.m:
	Flatten parallel conjunctions when inlining, as for plain conjunctions.

compiler/live_vars.m:
	Fix build_live_sets_in_par_conj to handle dependent parallel
	conjunctions.

compiler/liveness.m:
	Delay deaths in parallel conjunctions the same way as for plain
	conjunctions.

	Update detect_resume_points_in_par_conj for dependent parallel
	conjunctions.

compiler/mode_util.m:
	Treat parallel and plain conjunctions equally when recomputing instmap
	deltas.

compiler/modes.m:
compiler/unique_modes.m:
	Treat parallel and plain conjunctions equally when checking modes and
	uniqueness.  However, don't flatten parallel conjunctions into plain
	conjunctions and vice versa.

compiler/simplify.m:
	Don't reset instmaps and seen calls after each conjunct of a parallel
	conjunction.

compiler/store_alloc.m:
	Update allocation for dependent parallel conjunctions.

compiler/switch_detection.m:
	Detect switches in parallel conjunctions the same as plain
	conjunctions.

compiler/par_conj_gen.m:
	Add a todo comment.

tests/Mmakefile:
tests/par_conj/.cvsignore:
tests/par_conj/Mmakefile:
tests/par_conj/dep_par_1.m:
tests/par_conj/dep_par_10.m:
tests/par_conj/dep_par_11.m:
tests/par_conj/dep_par_11b.m:
tests/par_conj/dep_par_11c.m:
tests/par_conj/dep_par_12.m:
tests/par_conj/dep_par_13.m:
tests/par_conj/dep_par_14.m:
tests/par_conj/dep_par_14b.m:
tests/par_conj/dep_par_14c.m:
tests/par_conj/dep_par_14d.m:
tests/par_conj/dep_par_16.m:
tests/par_conj/dep_par_17.m:
tests/par_conj/dep_par_18.m:
tests/par_conj/dep_par_2.m:
tests/par_conj/dep_par_20.m:
tests/par_conj/dep_par_21.m:
tests/par_conj/dep_par_22.m:
tests/par_conj/dep_par_23.m:
tests/par_conj/dep_par_3.m:
tests/par_conj/dep_par_3b.m:
tests/par_conj/dep_par_3c.m:
tests/par_conj/dep_par_4.m:
tests/par_conj/dep_par_5.m:
tests/par_conj/dep_par_5b.m:
tests/par_conj/dep_par_5c.m:
tests/par_conj/dep_par_5d.m:
tests/par_conj/dep_par_6.m:
tests/par_conj/dep_par_7.m:
tests/par_conj/dep_par_8.m:
tests/par_conj/dep_par_9.m:
tests/par_conj/indep_par_append.exp:
tests/par_conj/indep_par_append.m:
tests/par_conj/indep_par_nested.exp:
tests/par_conj/indep_par_nested.m:
	Add some parallel conjunction test cases.  The dependent parallel
	conjunction tests are not yet executed as they can deadlock if there
	are not enough threads available.

browser/RESERVED_MACRO_NAMES:
library/RESERVED_MACRO_NAMES:
runtime/RESERVED_MACRO_NAMES:
trace/RESERVED_MACRO_NAMES:
	Add LINUX_THREADS, _REENTRANT and _THREAD_SAFE.
2006-06-28 04:46:26 +00:00
Julien Fischer
1f4fc6c1d4 Turn on the trailing tests in the test suite.
Estimated hours taken: 0
Branches: main

tests/Mmakefile:
	Turn on the trailing tests in the test suite.
2006-01-25 01:54:26 +00:00
Simon Taylor
886d2ae474 Make it easier to use shared libraries on x86 with
Estimated hours taken: 20
Branches: main

Make it easier to use shared libraries on x86 with
`mmc --make'.

There is now a third kind of object file, `.lpic_o'.
These files are compiled with `--pic-reg' but not with
CFLAGS_FOR_PIC, so they can be linked with shared Mercury
libraries.

On x86, executables which are linked with shared Mercury
libraries now depend on $(main_module.lpic_os), not
$(main_module.os).

This doesn't work with Mmake because ml doesn't know
which libraries are Mercury libraries, so it can't
link with the static versions of those libraries if
MERCURY_LINKAGE is set to "static".

configure.in:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
	Work out whether `.lpic_o' files are needed.

compiler/modules.m:
	Add `.lpic_o' to the list of grade or architecture
	dependent files.

NEWS:
README.Linux:
compiler/options.m:
doc/user_guide.texi:
	Document MERCURY_LINKAGE, LINKAGE, --linkage,
	--mercury-linkage and -R.

compiler/options_file.m:
compiler/make.program_target.m:
	Handle LINKAGE and MERCURY_LINKAGE variables.

	Allow LIBGRADES, LINKAGE and MERCURY_LINKAGE to be target-specific.

scripts/mmc.in:
	Set up the default linkage using the MERCURY_LINKAGE
	variable.

compiler/compile_target_code.m:
	Build `.lpic_o' files.

	Work out which type of object files to link with.

	When linking statically with Mercury libraries,
	find the absolute pathname for the `.a' file
	for each Mercury library, and pass that to ml,
	rather than just using `-lname'.

	Pass `-R' options to ml for each `-R' option to mmc.

compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/mercury_compile.m:
	Specify which type of object files to build.

compiler/make.program_target.m:
compiler/make.module_target.m:
	Make sure all generated object files are cleaned up.

compiler/prog_io.m:
	Add a better message for files which can't be found.

compiler/make.util.m:
	Add `.lpic_o' to the list of extensions.

compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	Pass `--linkage shared' to mmc (`--shared' is in MLFLAGS).

tests/Mmakefile:
tests/mmc_make/Mmakefile:
tests/mmc_make/Mercury.options:
tests/mmc_make/complex_test.{m,exp}:
tests/mmc_make/hello.{m,exp}:
	Test `mmc --make'.

tests/lib/complex*.m:
	The complex numbers library from the extras distribution,
	for use in the mmc_make tests.
2003-01-23 00:24:20 +00:00
Fergus Henderson
0801bd7263 Enable the tests in the `dppd' subdirectory.
Estimated hours taken: 0.25
Branches: main

tests/Mmakefile:
	Enable the tests in the `dppd' subdirectory.
2003-01-18 13:56:14 +00:00
Simon Taylor
7e3768fe68 Re-enable the recompilation tests, which were accidentally
Estimated hours taken: 0.1
Branches: main, release

tests/Mmakefile:
	Re-enable the recompilation tests, which were accidentally
	disabled when moving to the new test framework.
2003-01-10 12:21:20 +00:00
Simon Taylor
57bcfc05ba Improve the handling of `--use-grade-subdirs' so that it can
Estimated hours taken: 2.5
Branches: main

Improve the handling of `--use-grade-subdirs' so that it can
be documented.

compiler/compile_target_code.m:
	With `--use-grade-subdirs', link or copy executables
	and libraries into the user's directory.

compiler/make.program_target.m:
compiler/modules.m:
	Move code to create a symlink into modules.m, next to
	the code to create directories (all of this should really
	go in the standard library).

	Add a predicate to copy a file (which should also go
	in the standard library).

compiler/make.program_target.m:
	Make the realclean target delete the symlinks or copies
	of executables and libraries.

NEWS:
library/io.m:
	Add io__binary_input_stream_foldl, etc. for use in copying files.

NEWS:
compiler/options.m:
doc/user_guide.texi:
	Document `--use-grade-subdirs'.

tests/Mmakefile:
tests/grade_subdirs:
tests/grade_subdirs/Mmakefile:
tests/grade_subdirs/Mercury.options:
tests/grade_subdirs/hello.{m,exp}:
	Test case.
2002-10-31 14:47:44 +00:00
Fergus Henderson
85368c86d8 Delete this test case, and the directory containing it, since
Estimated hours taken: 0.25
Branches: main

tests/Mmakefile:
tests/typeclasses/Mmakefile:
tests/typeclasses/abstract_typeclasses.exp:
tests/typeclasses/abstract_typeclasses.m:
	Delete this test case, and the directory containing it, since
	(a) it is in the wrong place, and
	(b) there is already a test for this feature
	    in tests/hard_coded/typeclasses
	    (abstract_typeclass.m and use_abstract_typeclass.m).
2002-10-31 07:03:50 +00:00
Ralph Becket
5f62be845b Added typeclasses subdirectory to list of test directories.
Estimated hours taken: 0.1
Branches: main

tests/Mmakefile:
	Added typeclasses subdirectory to list of test directories.
2002-10-30 06:15:49 +00:00
Simon Taylor
47a4d62dc1 Improve the test framework to make it easier to find out which tests
Estimated hours taken: 30
Branches: main

Improve the test framework to make it easier to find out which tests
failed and to reduce disk usage (important in debug grades).

Allow the tests to be run with `mmc --make' (still some failures).

Allow the user to run only the failing tests from a previous
run by using `mmake ERROR_FILE=runtests.errs', where runtests.errs
is the log file from the previous run.

tests/Mmake.common:
tests/*/Mmakefile:
	Move common code (such as the code to deal with subdirectories)
	to Mmake.common.

	Run the tests using `mmake runtests' rather than using slightly
	different runtests scripts in each directory.

	Add to the output from `mmake runtests' to make it easier to
	identify which tests failed in which grades.

	Move per-module options into Mercury.options files so they
	can be read by `mmc --make'.

	Remove the last of the NU-Prolog support.

	Consistently use the main module name when listing tests.
	Some directories (e.g. invalid) were using the source file
	name.

tests/process_log.awk:
	Collect the parts of the output relating to failing tests.

tests/generate_exp:
tests/handle_options:
tests/subdir_runtests:
tests/startup:
tests/shutdown:
tests/*/runtests:
tests/recompilation/TESTS:
	Removed.

tests/recompilation/test_functions:
	Make sure the old result file is removed before starting
	each test.

	Put the mmake output for tests which are supposed to fail
	into a different file for each test.

tests/warnings/Mmakefile:
	Use %.c rather than $(cs_subdir)%.c in a rule.
	The $(cs_subdir) part doesn't work with `mmc --make',
	and isn't necessary any more (modules.m generates a rule
	`module.c: $(cs_subdir)module.c').

tests/README:
	Updated.

tools/bootcheck:
tools/test_mercury:
	Use `mmake runtests' instead of the `runtests' script.

	Add a `-f' (`--failing-tests') option to bootcheck which
	runs only the failing tests from the last run.

tools/test_mercury:
tools/run_all_tests_from_cron:
	Use the new framework to summarize test failures.
2002-08-17 13:52:35 +00:00
Simon Taylor
52d875b509 Prefix commands which recursively invoke mmake with `+'.
Estimated hours taken: 0.25

Mmakefile:
tests/Mmakefile:
tests/debugger/Mmakefile:
tests/general/Mmakefile:
tests/hard_coded/Mmakefile:
tests/invalid/Mmakefile:
	Prefix commands which recursively invoke mmake with `+'.
	This allow parallel make to work in the subdirectories,
	and avoids warnings such as:
		"gmake[1]: warning: jobserver unavailable: using -j1.
			Add `+' to parent make rule."
	Without the `+', the parent gmake does not attempt to
	communicate with the child gmake to decide how many processes
	the child gmake is allowed to run.
2001-09-02 10:33:07 +00:00
Zoltan Somogyi
9a52f06278 Add the debugger directory to the list of subdirectories.
Estimated hours taken: 0.1

tests/Mmakefile:
	Add the debugger directory to the list of subdirectories. The fact that
	it was missing meant that an "mmake clean" would not clean up the
	debugger directory.
2001-03-05 00:15:15 +00:00
Zoltan Somogyi
c0b36b2333 Add the new tabling directory to the list of directories.
Estimated hours taken: 1

tests/Mmakefile:
	Add the new tabling directory to the list of directories.

tests/tabling/Mmakefile:
tests/tabling/runtests:
	The intrastructure of the new tests directory.

tests/tabling/fib.{m,exp}:
	A test of the memoing of a det procedure.

tests/tabling/tc_loop.{m,exp}:
	A test of loop checking for a nondet procedure.

tests/tabling/tc_minimal.{m,exp}:
	A test of minimal model tabling for a nondet procedure.
	(Doesn't work yet).

tests/tabling/boyer.{m,exp}:
	A benchmark program, translated to Mercury by Bart Demoen
	from an original in Prolog.
	(Doesn't work yet).
1998-08-14 06:27:11 +00:00
Zoltan Somogyi
b4813457c9 A rewrite of termination analysis to make it significantly easier to modify,
Estimated hours taken: 60

A rewrite of termination analysis to make it significantly easier to modify,
and to extend its capabilities.

compiler/error_util.m:
	A new file containing code that makes it easier to generate
	nicely formatted error messages.

compiler/termination.m:
	Updates to reflect the changes to the representation of termination
	information.

	Instead of doing pass 1 on all SCCs and then pass 2 on all SCCs,
	we now do both pass 1 and 2 on an SCC before moving on to the next.

	Do not insist that either all procedures in an SCC are
	compiler-generated or all are user-written, since this need not be
	true in the presence of user-defined equality predicates.

	Clarify the structure of the code that handles builtins and compiler
	generated predicates.

	Concentrate all the code for updating module_infos in this module.
	Previously it was scattered in several places in several files.

	Put all the code for writing out termination information at the
	end of the module in a logical order.

compiler/term_traversal.m:
	A new file containing code used by both pass 1 and pass 2 to
	traverse procedure bodies.

compiler/term_pass1.m:
	Use the new traversal module.

	Clarify the fixpoint computation on the set of output supplier
	arguments.

	Remove duplicates from the list of equations given to the solver.
	This avoids a det stack overflow in lp.m when doing termination
	analysis on options.m.

	If an output argument of a predicate makes sense only in the absence
	of errors, then return it only in the absence of errors.

compiler/term_pass2.m:
	Use the new traversal module. Unlike the previous code, this allows us
	to ignore recursive calls with input arguments bigger than the head
	if those calls occur after goals that cannot succeed (since those
	calls will never be reached).

	Implement a better way of doing single argument analysis, which
	(unlike the previous version) works in the presence of mutual recursion
	and other calls between the recursive call and the start of the clause.

	Implement a more precise way of checking for recursions that don't
	cause termination problems. We now allow calls from p to q in which
	the recursive input supplier arguments can grow, provided that on
	any path on which q can call p, directly or indirectly, the recursive
	input supplier arguments shrink by a greater amount.

	If an output argument of a predicate makes sense only in the absence
	of errors, then return it only in the absence of errors.

compiler/term_util.m:
	Updates to reflect the changes to the representation of termination
	information.

	Reorder to put related code together.

	Change the interface of several predicates to better reflect the
	way they are used.

	Add some more utility predicates.

compiler/term_errors.m:
	Small changes to the set of possible errors, and major changes in
	the way the messages are printed out (we now use error_util).

compiler/options.m:
	Change --term-single-arg from being a bool to an int option,
	whose value indicates the maximum size of an SCC in which we try
	single argument analysis. (Large SCCs can cause single-arg analysis
	to require a lot of iterations.)

	Add an (int) option that controls the max number of paths
	that we are willing to analyze (analyzing too many paths can cause
	det stack overflow).

	Add an (int) option that controls the max number of causes of
	nontermination that we print out.

compiler/hlds_pred.m:
	Use two separate slots in the proc_info to hold argument size data
	and termination info, instead of the single slot used until now.
	The two kinds of information are produced and used separately.

	Make the layout of the get and set procedures for proc_infos more
	regular, to facilitate later updates.

	The procedures proc_info_{,set_}variables did the same work as
	proc_info_{,set_}varset. To eliminate potential confusion, I
	removed the first set.

compiler/*.m:
	Change proc_info_{,set_}variables to proc_info_{,set_}varset.

compiler/hlds_out.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
	Change the code to handle the arg size data and the termination
	info separately.

compiler/prog_data.m:
	Change the internal representation of termination_info pragmas to
	hold the arg size data and the termination info separately.

compiler/prog_io_pragma.m:
	Change the external representation of termination_info pragmas to
	group the arg size data together with the output supplier data,
	to which it is logically connected.

compiler/module_qual.m:
compiler/modules.m:
	Change the code to accommodate the change to the internal
	representation of termination_info pragmas.

compiler/notes/compiler_design.html:
	Fix some documentation rot, and clarify some points.

	Document termination analysis.

doc/user_guide.texi:
	Document --term-single-arg and the new options.

	Remove spaces from the ends of lines.

library/bag.m:
	Add a new predicate, bag__least_upper_bound.

	Fix code that would do the wrong thing if executed by Prolog.

	Remove spaces from the ends of lines.

library/list.m:
	Add a new predicate, list__take_upto.

library/set{,_ordlist}.m:
	Add a new predicate, set{,_ordlist}__count.

tests/term/*:
	A bunch of new test cases to test the behaviour of termination
	analysis. They are the small benchmark suite from our paper.

tests/Mmakefile:
	Enable the new test case directory.
1997-12-22 10:01:33 +00:00
Fergus Henderson
ddb73722b9 Rename all the Mmake' files as Mmakefile'. This is necessary to
avoid confusion between `Mmake' and `mmake' on case-insensitive file
systems.
1997-02-13 21:38:45 +00:00