Commit Graph

128 Commits

Author SHA1 Message Date
Mark Brown
784dc26cab Fix bugs that were stopping *.res and *.out files being cleaned up properly.
Estimated hours taken: 0.5

Fix bugs that were stopping *.res and *.out files being cleaned up properly.

tests/Mmake.common:
tests/general/accumulator/Mmakefile:
tests/invalid/Mmakefile:
tests/misc_tests/Mmakefile:
tests/tabling/Mmakefile:
tests/term/Mmakefile:
tests/valid/Mmakefile:
tests/warnings/Mmakefile:
	Make cleaning tasks depend on (real)clean_local rather than
	(real)clean.  This is because tests/startup and tests/shutdown
	use the *_local targets.

tests/general/Mmakefile:
	Fix bugs in the recursive mmake calls.
1999-07-14 17:04:41 +00:00
Mark Brown
55d0d482c6 Provide a more uniform interface to the test directories.
Estimated hours taken: 9

Provide a more uniform interface to the test directories.  Before this
change, the tests directory as well as direct descendents had `runtests'
scripts to execute the tests.  These would run `mmake', which in turn
would recursively run `mmake' in any subdirectories.  The subdirectories
did not have their own `runtests' scripts.

This change adds a `runtests' script to those subdirectories that did
not have them before.  The scripts have the same meaning as they did
previously---run all tests in the current directory and below, and
return a status of 0 only if all tests pass.

The rationale for this change is so that each directory in the tests
is treated the same, regardless of whether it is a top-level
directory or not.  This means, for example, that any test directory can
be used as an argument to the `--test-dir' option to tools/bootcheck.

This change also links tests/general/accumulator into the automated
testing suite.

tests/README:
	Update comments.

tests/Mmake.common:
	Introduce new target dependencies.  Targets of the form
	`foo' depend on the targets `foo_local' and `foo_subdirs'.

tests/subdir_runtests:
	New script to recursively call runtests scripts in subdirectories.
	Most of the code for this script originally came from
	tests/runtests.

tests/shutdown:
tests/startup:
	Use `realclean_local' as a target instead of `realclean', since
	the subdirectories will be handled by other runtests scripts.

tests/runtests:
tests/debugger/runtests:
tests/general/runtests:
tests/hard_coded/runtests:
	Use the new script to run tests in the subdirectories, rather
	than doing a recursive mmake.  Make sure that non-zero return
	values are propagated upwards where appropriate.

tests/debugger/declarative/runtests:
tests/hard_coded/typeclasses/runtests:
tests/hard_coded/sub-modules/runtests:
	New scripts to handle running tests in the subdirectories.

tests/debugger/Mmakefile:
tests/general/Mmakefile:
tests/hard_coded/Mmakefile:
	Add `*_subdirs' targets that do a recursive Mmake.  Change the
	existing targets to `*_local' ones.

tests/warnings/Mmakefile:
	Manually add the extra dependencies, since this Mmakefile does
	not include tests/Mmake.common.
1999-07-12 06:26:05 +00:00
Peter Ross
71d5cac51c Test cases for accumulator introduction.
Estimated hours taken: 50

Test cases for accumulator introduction.


INTRODUCED:
    Special file which records which procedures should be optimised.

README:
    Explain what the INTRODUCED file is for.

runtests:
    Run the tests.

base.exp:
base.m:
call_in_base.exp:
call_in_base.m:
chain.exp:
chain.m:
construct.exp:
construct.m:
dcg.exp:
dcg.m:
deconstruct.exp:
deconstruct.m:
disj.exp:
disj.m:
heuristic.exp:
heuristic.m:
highorder.exp:
highorder.m:
identity.exp:
identity.m:
inter.exp:
inter.m:
nonrec.exp:
nonrec.m:
out_to_in.exp:
out_to_in.m:
qsort.exp:
qsort.m:
simple.exp:
simple.m:
split.exp:
split.m:
swap.exp:
swap.m:
    The actual tests.

Mmakefile:
    the usual.
1999-06-16 06:19:37 +00:00
Fergus Henderson
6accb8113d Fix some spurious test cases failures for the debugging test cases.
Estimated hours taken: 0.25

Fix some spurious test cases failures for the debugging test cases.

tests/debugger/*.exp2:
	Add alternative expected outputs for the test cases that
	produce different results when built in debug grades (i.e.
	when linked with a library was built with debugging enabled).
1998-11-16 07:26:58 +00:00
Fergus Henderson
b8aed5707b Allow test cases to have more than one expected output.
Estimated hours taken: 0.5

tests/Mmake.common:
	Allow test cases to have more than one expected output.

tests/general/string_format_test_2.exp2:
tests/general/string_format_test_3.exp2:
tests/hard_coded/no_fully_strict.exp2:
	Add alternative expected output for these
	test cases, since the output is different
	depending on whether or not the program is
	compiled in a grade that supports stack traces.
1998-11-04 07:53:29 +00:00
Fergus Henderson
1abfe12072 Fix a number of places where there were the wrong
Estimated hours taken: 0.1

tests/general/string_format_test.m:
	Fix a number of places where there were the wrong
	number of arguments in the list passed to string__format.
	These needed to be fixed now that string__format is
	more picky about rejecting those sort of errors.
1998-10-28 08:56:08 +00:00
Fergus Henderson
674d66cbad Fix a bug in string__format: it was not reporting an error
Estimated hours taken: 0.75

library/string.m:
	Fix a bug in string__format: it was not reporting an error
	in the case where the argument list had more elements
	than was appropriate for the format string.

tests/general/Mmakefile:
tests/general/string_format_test_2.m:
tests/general/string_format_test_2.exp:
tests/general/string_format_test_3.m:
tests/general/string_format_test_3.exp:
	Test cases for the above-mentioned bug fix.
1998-10-27 15:36:42 +00:00
Zoltan Somogyi
c10175956e Ignore the CLEAN file.
Estimated hours taken: 0.1

tests/*/.cvsignore:
	Ignore the CLEAN file.
1998-09-30 04:23:44 +00:00
Tyson Dowd
1e4b34389f Move merge_and_remove_dups from general to hard_coded, because
Estimated hours taken: 0.5

general/Mmakefile:
general/merge_and_remove_dups.exp:
general/merge_and_remove_dups.m:
hard_coded/Mmakefile:
hard_coded/merge_and_remove_dups.exp:
hard_coded/merge_and_remove_dups.m:
	Move merge_and_remove_dups from general to hard_coded, because
	NU-Prolog thinks the list of ints is a list of ASCII characters,
	and so outputs a different result.
1998-09-21 13:18:05 +00:00
Tyson Dowd
32cae3cb02 Move merge_and_remove_dups from general to hard_coded, because
Estimated hours taken: 0.5

general/Mmakefile:
general/merge_and_remove_dups.exp:
general/merge_and_remove_dups.m:
hard_coded/Mmakefile:
hard_coded/merge_and_remove_dups.exp:
hard_coded/merge_and_remove_dups.m:
	Move merge_and_remove_dups from general to hard_coded, because
	NU-Prolog thinks the list of ints is a list of ASCII characters,
	and so outputs a different result.
1998-09-21 13:18:01 +00:00
Tyson Dowd
fd42954d72 Fix a bug reported by Peter Herkenrath <aik01@rrz.uni-koeln.de>.
Estimated hours taken: 1

Fix a bug reported by Peter Herkenrath <aik01@rrz.uni-koeln.de>.

library/list.m:
	Make list__merge_and_remove_dups/4 recursively call itself,
	not list__merge.

tests/general/Mmakefile:
tests/general/merge_and_remove_dups.exp:
tests/general/merge_and_remove_dups.m:
	A regression test for this bug.
1998-09-15 07:49:47 +00:00
Andrew Bromage
586c5e16c6 Implement io__read_line_as_string/{3,4}.
Estimated hours taken: 10

library/io.m:
library/io.nu.nl:
	Implement io__read_line_as_string/{3,4}.

	Also sneaked in here are some trivial whitespace fixes in some
	of the pragma c_code which did not comply with our coding
	standards (to do with type casting).

samples/cat.m:
samples/sort.m:
	Use io__read_line_as_string.

tests/general/Mmakefile:
tests/general/read_line_as_string.exp:
tests/general/read_line_as_string.m:
	Test case for io__read_line_as_string.

NEWS:
	Mention the above change.
1998-09-09 06:05:30 +00:00
Zoltan Somogyi
72c3829fb9 Fix a subtle bug in the new way of handling failure.
Estimated hours taken: 8

Fix a subtle bug in the new way of handling failure. When we enter the
last disjunct of a model_non disjunction inside the model_non condition
of an if-then-else, set resume_point_known to unknown. This forces code
in the last disjunct and after the last disjunction to fail by invoking
redo(), not by a direct branch. The reason this is necessary that a direct
branch to the start of the else case is incorrect if the condition has
already returned some answers.

The bug was causing tests/general/complex_failure to fail at optimization
levels that caused the inlining of a predicate, which resulted in a disjunction
inside the last disjunct of a disjunction inside a model_non condition.

compiler/notes/failure.html:
	Modify the description of failure handling to encompass the solution
	of the problem.

compiler/code_info.m:
	Implement the solution.

tests/general/semi_fail_in_non_ite.{m,exp}:
	Add a new test case, a variant of complex_failure, that tests for the
	bug at all optimization levels.

tests/general/Mmakefile:
	Enable the new test case.

tests/general/complex_failure.m:
	Remove an obsolete comment.
1998-08-07 05:13:17 +00:00
Zoltan Somogyi
ed063bcc00 Extend the new failure handling method to optionally preserve an invariant
Estimated hours taken: 30

Extend the new failure handling method to optionally preserve an invariant
required by accurate gc: always being able to tell with respect to what MR_sp
or MR_curfr to interpret the stackvars and framevars referred to by the label
whose address is the redoip slot of a nondet stack frame. This basically
requires limitations on the hijacking of redoip/redofr slot pairs.

compiler/notes/failure.html:
	Describe the new extension.

	Change the terminology to conform to what is used in the code.

compiler/llds.m:
	For each temporary frame on the nondet stack, specify the native
	stack of the procedure that created it. This is so that we know
	whether the temporary frame ought to have the fourth slot that
	specifies the right value of MR_sp. (The fourth slot is included
	only in temporary nondet stack frames created procedures that live
	on the det stack; procedures that live on the nondet stack never
	have any of their variables on the det stack.)

	Remove the modframe llds instruction, since it does not specify
	what frame's redoip slot it is assigning to. This is error-prone
	(see peephole.m below). We were not using modframe much anyway.

compiler/llds_out.m:
compiler/opt_debug.m:
	Emit either mktempframe or mkdettempframe depending on the new
	field in temp_frame.

compiler/code_info.m:
	Add a fourth item to the failure state, which states whether
	the top frame of the nondet stack may be hijacked. Initialize
	it from the option --allow-hijacks. If about to do a hijack
	but the failure state says no, create a temporary frame instead.

	Separate out the code for creating temporary frames, since it
	is now called from more than one place. Generalize the code
	to handle the new type of temp frame.

compiler/code_info.m:
compiler/ite_gen.m:
	Simplify the way we transmit information about the location
	of the address of the nondet stack frame in which the soft cut
	is performed from the start of the condition to its end.

	Remove the predicate code_info__maybe_push_temp_frame;
	its functionality is now achieved in code_info.m by disabling
	and restoring --allow-hijacks around the generation of code
	for the condition. This also allows us to get rid of the code
	that finds out whether the condition can do any hijacking.

compiler/opt_util.m:
	Rename next_modframe as next_assign_to_redoip, and add an additional
	argument that says which frame's redoip we are after.

compiler/peephole.m:
	Use the new argument of opt_util__next_assign_to_redoip to fix a bug
	where a mkframe of a temporary frame (which leaves curfr unchanged)
	that was followed a modframe (which assigns to the redoip of curfr)
	was incorrectly optimized (the assignment to the redoip slot was
	applied to the temporary frame, not the ordinary one).

compiler/*.m:
	Minor changes to accommodate the disappearance of modframe.

runtime/mercury_stacks.h:
	Add macros to support four-word temp frames on the nondet stack.

	Make the macros that access nondet stack frame slots start with MR_,
	while keeping (redefined) macros needed for backward compatibility.

	Remove the modframe macro.

	Fix a dangling reference to PREDNM instead of MR_PREDNM.

runtime/mercury_stack_trace.c:
	Modify the stack tracing code to allow for the new four-word temp
	frames.

	Use the new MR_ prefixed variants of the macros.

runtime/mercury_debug.h:
runtime/mercury_misc.[ch]:
	Remove references to modframe.

tests/general/complex_failure.{m,exp}:
	A new test case to tickle the various ways of handling nested
	disjunctions and if-then-elses in the new code generator.

tests/general/Mmakefile:
	Enable the new test case.

tests/{general,hard_coded}/space.{m,exp}:
	Move this test case from general to hard_coded. Although NU-Prolog
	can execute it, it does not give the same answers as Mercury due to
	a different default ordering and a difference in integer size (26-bit
	integers in NU-Prolog) that changes the behavior of the pseudo
	random-number generator.

tests/hard_coded/cycles2.exp:
	Add the missing .exp file for this existing test case.

tests/hard_coded/Mmakefile:
	Enable the old test cases cycles, cycles2 and space, since
	we now pass them.
1998-07-29 08:57:09 +00:00
Fergus Henderson
2dd14c4726 Delete some long obsolete references to `.mod' files.
Estimated hours taken: 0.25

tests/general/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/typeclasses/Mmakefile:
tests/misc_tests/Mmakefile:
	Delete some long obsolete references to `.mod' files.
1998-07-27 11:09:35 +00:00
Fergus Henderson
19dab51e85 Put the correct module name in the `:- module' declaration,
Estimated hours taken: 0.25

tests/general/double_error2.m:
tests/hard_coded/eqv_type_bug.m:
	Put the correct module name in the `:- module' declaration,
	to avoid an error from `mmc --generate-dependencies'.
1998-06-16 03:11:36 +00:00
Fergus Henderson
eae7eec887 Allow modules to be put in source files whose names do not directly match
Estimated hours taken: 10

Allow modules to be put in source files whose names do not directly match
their the module names.  When looking for the source for a module such
as `foo:bar:baz', search for it first in `foo.bar.baz.m', then in `bar.baz.m',
and finally in `baz.m'.

compiler/prog_io.m:
	Change prog_io__read_module so that it returns the name of
	the module read, as determined by the `:- module' declaration.
	Add predicate `check_module_has_expected_name', for checking
	that this name matches what was expected.

compiler/modules.m:
	Add read_mod_from_file, for reading a module given the file name,
	and generated_file_dependencies, for generating the dependencies
	of a module given the file name.  (As opposed to the module name.)
	Change read_mod and read_mod_ignore_errors so that they
	search for `.m' files as described above, and return the name
	of the source file read.
	Also improve the efficiency of read_dependencies slightly:
	when reading in `.int' files, there's no need to call
	split_into_submodules, because we generate a seperate
	`.int' file for each submodule anyway.

compiler/mercury_compile.m:
	Change the handling of command-line arguments.
	Arguments ending with `.m' are assumed to be file names,
	and other arguments are assumed to be module names.
	For file names, call read_mod_from_file instead of read_mod.

compiler/handle_options.m:
	Change help message to reflect the above change to the semantics
	of command-line arguments.

compiler/intermod.m:
compiler/trans_opt.m:
	Fix a bug: call prog_io__read_opt_file instead of prog_io__read_module.

doc/user_guide.texi:
	Document the above change to the semantics of command-line arguments.
	Update the "libraries" chapter to reflect our support for nested
	modules.

tests/*/*.m:
tests/*/*.exp:
	Fix a few incorrect module names in `:- module' declarations.
1998-05-29 08:57:42 +00:00
Fergus Henderson
b372b47380 s/mercury_builtin/builtin/
Estimated hours taken: 0.25

tests/general/parse_list.m:
tests/general/semidet_map.m:
	s/mercury_builtin/builtin/
1998-05-28 14:29:46 +00:00
Fergus Henderson
0470b29931 Disable the dnf' test case, since it uses tabling (pragma memo')
Estimated hours taken: 0.1

tests/general/Mmakefile:
	Disable the `dnf' test case, since it uses tabling (`pragma memo')
	which isn't implemented in non-gc grades yet.
1998-05-16 15:53:04 +00:00
Zoltan Somogyi
564d358da3 Avoid about half of the slow "mmake realclean"s required by a bootcheck.
Estimated hours taken: 0.5

Avoid about half of the slow "mmake realclean"s required by a bootcheck.

tests/*/runtests:
	Concentrate all the actions performed before the test and after
	a successful tests (both of which involve an "mmake realclean")
	into two scripts, tests/{startup,shutdown}.

tests/shutdown:
	Clean up the directory, and touch the file CLEAN.

tests/startup:
	If the file CLEAN exists and is the most recent file in the directory,
	consider the directory clean to beging with. Otherwise, run mmake
	realclean.
1998-05-13 04:06:38 +00:00
Zoltan Somogyi
cd31eecf88 When reporting the results, print the options that controlled
Estimated hours taken: 0.2

tests/runtests:
tests/*/runtests:
	When reporting the results, print the options that controlled
	the tests, so you don't have to search for them.

tests/*/runtests:
	Clean up the directory if the tests are successful, in order
	to reduce disk space usage.
1998-04-23 09:28:39 +00:00
Bert Thompson
30ef37923c Moved tests of library/{integer,rational}.m from tests/general to
Estimated hours taken: 0.1

Moved tests of library/{integer,rational}.m from tests/general to
tests/hard_coded since the library modules and their tests cannot
be compiled under NU-Prolog.

general/Mmakefile:
general/.cvsignore:
	Removed references to integer_test and rational_test.
general/integer_test.m:
general/integer_test.exp:
general/rational_test.exp:
general/rational_test.m:
	File removed.
hard_coded/Mmakefile:
hard_coded/.cvsignore:
	Added references to integer_test and rational_test.
hard_coded/integer_test.m:
hard_coded/integer_test.exp:
hard_coded/rational_test.exp:
hard_coded/rational_test.m:
	File added.
1998-04-16 12:00:32 +00:00
Bert Thompson
c52faca450 Added tests for library/rational.m
Estimated hours taken: 1

Added tests for library/rational.m


general/rational_test.m:
	Test module for library/rational.m.
general/rational_test.exp:
	Expected output of test.
general/Mmakefile:
	Added rational_test.
general/.cvsignore:
	Added rational_test.
1998-04-16 07:20:18 +00:00
Bert Thompson
8109f07cb3 Added simple tests for library/integer.m.
Estimated hours taken: 0.5

Added simple tests for library/integer.m.


general/integer_test.m:
	Added tests for library/integer.m, the big integer module.
general/integer_test.exp:
	Expected output.
general/Mmakefile:
	Added integer_test.
general/.cvsignore:
	Added integer_test.
1998-04-15 08:14:05 +00:00
Fergus Henderson
713349d3e6 Move the rtc_bug' test case from the general'
Estimated hours taken: 0.2

tests/general/Mmakefile:
tests/general/rtc_bug.m:
tests/general/rtc_bug.exp:
tests/general/.cvsignore:
tests/hard_coded/Mmakefile:
tests/hard_coded/rtc_bug.m:
tests/hard_coded/rtc_bug.exp:
tests/hard_coded/.cvsignore:
	Move the `rtc_bug' test case from the `general'
	directory to the `hard_coded' directory, since it doesn't
	work in Prolog.
1998-04-02 13:18:47 +00:00
Fergus Henderson
345a9e7946 Ignore executables created for recently added test cases.
Estimated hours taken: 0.05

tests/general/.cvsignore:
	Ignore executables created for recently added test cases.
1998-04-02 11:24:11 +00:00
Fergus Henderson
86d6c4398e Move the relation_test' test case from the general'
Estimated hours taken: 0.25

tests/general/Mmakefile:
tests/general/relation_test.m:
tests/general/relation_test.exp:
tests/hard_coded/Mmakefile:
tests/hard_coded/relation_test.m:
tests/hard_coded/relation_test.exp:
	Move the `relation_test' test case from the `general'
	directory to the `hard_coded' directory, since it doesn't
	work in Prolog.
1998-03-27 16:42:32 +00:00
Andrew Bromage
9d58fa5725 relation__rtc was just plain broken. Rather than try to fix an
Estimated hours taken: 3

relation__rtc was just plain broken.  Rather than try to fix an
algorithm which I pulled out of an obscure paper some years ago, it's
now replaced with a slightly less efficient algorithm which is much
easier to understand.

library/relation.m:
	Changes detailed above.

tests/Makefile:
tests/rtc_bug.m:
tests/rtc_bug.exp:
	Test case for the above change.

tests/relation_test.m:
tests/relation_test.exp:
	Change in output format to make debugging easier.
1998-03-26 00:43:41 +00:00
Fergus Henderson
39472195ec Add new predicate relation__add_values.
Estimated hours taken: 2

library/relation.m:
	Add new predicate relation__add_values.
	Implement the previously commented-out predicates
	relation__from_assoc_list and relation__compose.
	Change relation__to_assoc_list so that it returns
	an assoc list of values rather than an assoc list
	of relation_keys.

NEWS:
	Document the above changes.

tests/general/Mmakefile:
tests/general/relation_test.m:
tests/general/relation_test.exp:
	Add a few tests of the relation module.
1998-03-12 21:11:30 +00:00
Fergus Henderson
2823abbcac Move the common_type_cast' test from the general' directory
Estimated hours taken: 0.25

tests/general/Mmakefile:
tests/general/common_type_cast.m:
tests/general/common_type_cast.exp:
tests/hard_coded/Mmakefile:
tests/hard_coded/common_type_cast.m:
tests/hard_coded/common_type_cast.exp:
	Move the `common_type_cast' test from the `general' directory
	to the `hard_coded' directory.  The reason for this was that
	the output under Mercury is slightly different to the output
	under NU-Prolog (the difference being trailing zeroes on
	floating point numbers); moving the test to the `hard_coded'
	directory was the simplest way of fixing this.
1998-03-10 11:09:30 +00:00
Fergus Henderson
fb3551d55c Ignore some recently-added tests.
Estimated hours taken: 0.05

tests/general/.cvsignore:
	Ignore some recently-added tests.

tests/general/Mmakefile:
	Add a comment saying that `.cvsignore' should be updated if
	you add new programs.
1998-03-09 09:17:51 +00:00
Fergus Henderson
f8b8aa164b Use is' rather than =' for arithmetic, since otherwise
Estimated hours taken: 0.25

tests/general/common_type_cast.m:
	Use `is' rather than `=' for arithmetic, since otherwise
	it doesn't work under NU-Prolog or SICStus Prolog.
1998-03-08 00:17:30 +00:00
Fergus Henderson
11d8161692 Add support for nested modules.
Estimated hours taken: 50

Add support for nested modules.

- module names may themselves be module-qualified
- modules may contain `:- include_module' declarations
  which name sub-modules
- a sub-module has access to all the declarations in the
  parent module (including its implementation section).

This support is not yet complete; see the BUGS and LIMITATIONS below.

LIMITATIONS
- source file names must match module names
	(just as they did previously)
- mmc doesn't allow path names on the command line any more
	(e.g. `mmc --make-int ../library/foo.m').
- import_module declarations must use the fully-qualified module name
- module qualifiers must use the fully-qualified module name
- no support for root-qualified module names
	(e.g. `:parent:child' instead of `parent:child').
- modules may not be physically nested (only logical nesting, via
  `include_module').

BUGS
- doesn't check that the parent module is imported/used before allowing
	import/use of its sub-modules.
- doesn't check that there is an include_module declaration in the
	parent for each module claiming to be a child of that parent
- privacy of private modules is not enforced

-------------------

NEWS:
	Mention that we support nested modules.

library/ops.m:
library/nc_builtin.nl:
library/sp_builtin.nl:
compiler/mercury_to_mercury.m:
	Add `include_module' as a new prefix operator.
	Change the associativity of `:' from xfy to yfx
	(since this made parsing module qualifiers slightly easier).

compiler/prog_data.m:
	Add new `include_module' declaration.
	Change the `module_name' and `module_specifier' types
	from strings to sym_names, so that module names can
	themselves be module qualified.

compiler/modules.m:
	Add predicates module_name_to_file_name/2 and
	file_name_to_module_name/2.
	Lots of changes to handle parent module dependencies,
	to create parent interface (`.int0') files, to read them in,
	to output correct dependencies information for them to the
	`.d' and `.dep' files, etc.
	Rewrite a lot of the code to improve the readability
	(add comments, use subroutines, better variable names).
	Also fix a couple of bugs:
	- generate_dependencies was using the transitive implementation
	  dependencies rather than the transitive interface dependencies
	  to compute the `.int3' dependencies when writing `.d' files
	  (this bug was introduced during crs's changes to support
	  `.trans_opt' files)
	- when creating the `.int' file, it was reading in the
	  interfaces for modules imported in the implementation section,
	  not just those in the interface section.
	  This meant that the compiler missed a lot of errors.

library/graph.m:
library/lexer.m:
library/term.m:
library/term_io.m:
library/varset.m:
compiler/*.m:
	Add `:- import_module' declarations to the interface needed
	by declarations in the interface.  (The previous version
	of the compiler did not detect these missing interface imports,
	due to the above-mentioned bug in modules.m.)

compiler/mercury_compile.m:
compiler/intermod.m:
	Change mercury_compile__maybe_grab_optfiles and
	intermod__grab_optfiles so that they grab the opt files for
	parent modules as well as the ones for imported modules.

compiler/mercury_compile.m:
	Minor changes to handle parent module dependencies.
	(Also improve the wording of the warning about trans-opt
	dependencies.)

compiler/make_hlds.m:
compiler/module_qual.m:
	Ignore `:- include_module' declarations.

compiler/module_qual.m:
	A couple of small changes to handle nested module names.

compiler/prog_out.m:
compiler/prog_util.m:
	Add new predicates string_to_sym_name/3 (prog_util.m) and
	sym_name_to_string/{2,3} (prog_out.m).

compiler/*.m:
	Replace many occurrences of `string' with `module_name'.
	Change code that prints out module names or converts
	them to strings or filenames to handle the fact that
	module names are now sym_names intead of strings.
	Also change a few places (e.g. in intermod.m, hlds_module.m)
	where the code assumed that any qualified symbol was
	fully-qualified.

compiler/prog_io.m:
compiler/prog_io_goal.m:
	Move sym_name_and_args/3, parse_qualified_term/4 and
	parse_qualified_term/5 preds from prog_io_goal.m to prog_io.m,
	since they are very similar to the parse_symbol_name/2 predicate
	already in prog_io.m.  Rewrite these predicates, both
	to improve maintainability, and to handle the newly
	allowed syntax (module-qualified module names).
	Rename parse_qualified_term/5 as `parse_implicit_qualified_term'.

compiler/prog_io.m:
	Rewrite the handling of `:- module' and `:- end_module'
	declarations, so that it can handle nested modules.
	Add code to parse `include_module' declarations.

compiler/prog_util.m:
compiler/*.m:
	Add new predicates mercury_public_builtin_module/1 and
	mercury_private_builtin_module/1 in prog_util.m.
	Change most of the hard-coded occurrences of "mercury_builtin"
	to call mercury_private_builtin_module/1 or
	mercury_public_builtin_module/1 or both.

compiler/llds_out.m:
	Add llds_out__sym_name_mangle/2, for mangling module names.

compiler/special_pred.m:
compiler/mode_util.m:
compiler/clause_to_proc.m:
compiler/prog_io_goal.m:
compiler/lambda.m:
compiler/polymorphism.m:
	Move the predicates in_mode/1, out_mode/1, and uo_mode/1
	from special_pred.m to mode_util.m, and change various
	hard-coded definitions to instead call these predicates.

compiler/polymorphism.m:
	Ensure that the type names `type_info' and `typeclass_info' are
	module-qualified in the generated code.  This avoids a problem
	where the code generated by polymorphism.m was not considered
	type-correct, due to the type `type_info' not matching
	`mercury_builtin:type_info'.

compiler/check_typeclass.m:
	Simplify the code for check_instance_pred and
	get_matching_instance_pred_ids.

compiler/mercury_compile.m:
compiler/modules.m:
	Disallow directory names in command-line arguments.

compiler/options.m:
compiler/handle_options.m:
compiler/mercury_compile.m:
compiler/modules.m:
	Add a `--make-private-interface' option.
	The private interface file `<module>.int0' contains
	all the declarations in the module; it is used for
	compiling sub-modules.

scripts/Mmake.rules:
scripts/Mmake.vars.in:
	Add support for creating `.int0' and `.date0' files
	by invoking mmc with `--make-private-interface'.

doc/user_guide.texi:
	Document `--make-private-interface' and the `.int0'
	and `.date0' file extensions.

doc/reference_manual.texi:
	Document nested modules.

util/mdemangle.c:
profiler/demangle.m:
	Demangle names with multiple module qualifiers.

tests/general/Mmakefile:
tests/general/string_format_test.m:
tests/general/string_format_test.exp:
tests/general/string__format_test.m:
tests/general/string__format_test.exp:
tests/general/.cvsignore:
	Change the `:- module string__format_test' declaration in
	`string__format_test.m' to `:- module string_format_test',
	because with the original declaration the `__' was taken
	as a module qualifier, which lead to an error message.
	Hence rename the file accordingly, to avoid the warning
	about file name not matching module name.

tests/invalid/Mmakefile:
tests/invalid/missing_interface_import.m:
tests/invalid/missing_interface_import.err_exp:
	Regression test to check that the compiler reports
	errors for missing `import_module' in the interface section.

tests/invalid/*.err_exp:
tests/warnings/unused_args_test.exp:
tests/warnings/unused_import.exp:
	Update the expected diagnostics output for the test cases to
	reflect a few minor changes to the warning messages.

tests/hard_coded/Mmakefile:
tests/hard_coded/parent.m:
tests/hard_coded/parent.child.m:
tests/hard_coded/parent.exp:
tests/hard_coded/parent2.m:
tests/hard_coded/parent2.child.m:
tests/hard_coded/parent2.exp:
	Two simple tests case for the use of nested modules with
	separate compilation.
1998-03-03 17:48:14 +00:00
Simon Taylor
4ab55e32a5 Fix a bug in the optimization where polymorphism.m passes a
Estimated hours taken: 5

Fix a bug in the optimization where polymorphism.m passes a
base_type_info in place of a type_info for non-polymorphic types.
The type of the variable was `base_type_info' not `type_info'.
This caused inlining.m to be unable to compute a type substitution,
and code_util__cons_id_to_tag aborted on an unsubstituted type
variable.

compiler/mercury_builtin.m
compiler/code_util.m
	Add a new builtin, unsafe_type_cast/2, used by common.m
	to preserve type correctness.
	Make unsafe_promise_unique/2 a builtin, since it is basically
	the same as unsafe_type_cast/2.

compiler/polymorphism.m
	Set the type of a `base_type_info' passed where a `type_info'
	is expected to `type_info'.
	Don't add the type_info argument for unsafe_type_cast, since it is
	not needed and would make the code in common.m more complicated.

compiler/common.m
	Generate a call to unsafe_type_cast rather than an assignment
	unification when the assignment would not be type correct.

tests/valid/inlining_bug.m
	Regression test.

tests/general/common_type_cast.m
tests/general/common_type_cast.exp
	Test of type casts.
1998-02-25 00:12:16 +00:00
Simon Taylor
94cc77f4c3 Bug fixes for inter-module optimization
Estimated hours taken: 1.5

Bug fixes for inter-module optimization

compiler/Mmakefile
	Use the `.int' files in $(LIBRARY_DIR) rather than the installed
	`.int' files when creating `.opt' files for the compiler.

compiler/intermod.m
	Handle higher-order function calls properly. This caused
	mmc --make-optimization-interface --enable-termination \
			tests/hard_coded/agg.m to fail.
	Make sure types used by abstract exported types are made
	exported when compiling to C. This ensures that the
	base_type_infos are exported, avoiding link errors.

tests/general/intermod_type.m
tests/general/intermod_type2.m
tests/general/intermod_type.exp
	Regression test for abstract exported types.
1998-02-18 23:42:28 +00:00
Fergus Henderson
a40e5c8cdb Add a comment (saying that the problem with string_test.m in
Estimated hours taken: 0.1

tests/general/Mmakefile:
	Add a comment (saying that the problem with string_test.m in
	this directory also occurs for tests/hard_coded/mode_choice.m).
1998-02-11 09:23:08 +00:00
Fergus Henderson
7e0a5bd4a3 Fix a couple of bugs (use of use_module' instead of import_module')
Estimated hours taken: 0.25

tests/mode_inf.m:
	Fix a couple of bugs (use of `use_module' instead of `import_module')
	in the test case.
1998-01-15 01:44:08 +00:00
Fergus Henderson
cb55056e8f Add another test of mode inference.
Estimated hours taken: 0.5

tests/general/Mmakefile:
tests/general/mode_inf.m:
tests/general/mode_inf.exp:
	Add another test of mode inference.
1998-01-14 03:24:05 +00:00
Fergus Henderson
9000f9e47a Add support for setting MLFLAGS-foo' to alter the MLFLAGS'
Estimated hours taken: 3

tests/Mmake.common:
	Add support for setting `MLFLAGS-foo' to alter the `MLFLAGS'
	used for compiling `foo'.

tests/general/Mmakefile:
	Set `MLFLAGS-string_test' to `--no-strip', to work around a bug
	(probably in the Solaris linker) that shows up when this test
	is run on kryten with options `-O1 --opt-space' in grade `none'.
1998-01-09 04:57:34 +00:00
Fergus Henderson
6e06050558 Rename Mmake' as Mmakefile', since using the name `Mmake'
Estimated hours taken: 0.25

*/Mmake:
	Rename `Mmake' as `Mmakefile', since using the name `Mmake'
	causes problems on case-insensitive file systems.
1997-09-29 18:05:38 +00:00
Fergus Henderson
936a3e34ba Disable the `space.m' test for now, since we don't pass it,
Estimated hours taken: 0.25

tests/general/Mmake:
	Disable the `space.m' test for now, since we don't pass it,
	and the fix is difficult.
1997-09-09 18:03:01 +00:00
Fergus Henderson
942c79fe58 Re-enable the `space.m' test, since it seems to work now.
Estimated hours taken: 0.25

tests/general/Mmake:
	Re-enable the `space.m' test, since it seems to work now.

tests/general/space.m:
	Add a missing `:- import_module char'.
1997-08-16 04:30:48 +00:00
Fergus Henderson
ccbc3cbcd2 Replace t::(...)' with t :: (...)', because NU-Prolog thinks
Estimated hours taken: 0.25

tests/general/prune_switch.m:
	Replace `t::(...)' with `t :: (...)', because NU-Prolog thinks
	the former is a syntax error.
1997-08-15 07:37:21 +00:00
Fergus Henderson
6c7a606992 Ignore executables for some recently added tests.
Estimated hours taken: 0.25

tests/general/.cvsignore:
	Ignore executables for some recently added tests.
1997-08-11 08:04:06 +00:00
Fergus Henderson
be5138da5c Remove `:- import_module time', since (a) it was not needed
Estimated hours taken: 0.25

test/general/mode_inf_bug.m:
	Remove `:- import_module time', since (a) it was not needed
	and (b) the `time' module has been renamed `benchmarking'.
1997-08-09 03:36:26 +00:00
Andrew Bromage
4d190a1dff Changes to make array_test.m run under NU-Prolog.
Estimated hours taken: 0.5

Changes to make array_test.m run under NU-Prolog.

tests/general/array_test.m:
	Remove one function call (use the predicate version) and
	replace calls to io__write with their typed versions.
1997-08-01 06:22:10 +00:00
Andrew Bromage
85915ad88a The main purpose of this change is to rename array.m as bt_array.m, and
Estimated hours taken: 6

The main purpose of this change is to rename array.m as bt_array.m, and
uniq_array.m as array.m.  The interfaces of those two modules have grown
slightly so that they match a little more closely.  Details are in the
file NEWS.

The implementation of bt_array (formerly array) has been changed to use
a slightly more efficient implementation.

NEWS:
        Interface changes documented.

library/array.m:
library/bt_array.m:
        Changes mentioned above and detailed in the NEWS file.

library/uniq_array.m:
        Bereft of life and resting in peace.

library/io.m:
library/library.m:
library/std_util.m:
library/term.m:
compiler/base_type_layout.m:
runtime/deep_copy.c:
runtime/type_info.h:
        Minor changes to fix the special case of base_type_layout
        operations for arrays rather than uniq_arrays.

tests/hard_coded/write.exp:
tests/hard_coded/write.m:
        Test writing of arrays.

tests/general/array_test.exp:
tests/general/array_test.m:
        Test some array/bt_array operations.
1997-07-25 05:16:31 +00:00
Simon Taylor
7974b579ef Fix some places where goal_info fields were not being filled
Estimated hours taken: 1

compiler/simplify.m
compiler/higher_order.m
	Fix some places where goal_info fields were not being filled
	in correctly.

compiler/hlds_goal.m
	Added goal_info_init/4 which takes the nonlocals, instmap_delta
	and determinism of the goal. All goal_info_inits after determinism
	analysis should probably use this version.

compiler/common.m
compiler/polymorphism.m
	Use goal_info_init/4.

tests/general/prune_switch.m
	Test case.
1997-07-25 02:38:44 +00:00
Simon Taylor
ec6fdec2aa Remove the rule for clean, since it removed the .dep files
Estimated hours taken: 0.01

tests/general/Mmake
	Remove the rule for clean, since it removed the .dep files
	which meant that mmake realclean didn't remove the executables.
1997-07-23 23:25:40 +00:00
Fergus Henderson
eef924930d If the tests succeeded, remove the `.allres' file, rather than
Estimated hours taken: 0.25

test/*/runtests:
	If the tests succeeded, remove the `.allres' file, rather than
	leaving it lying around.
1997-07-14 03:18:46 +00:00