Commit Graph

5 Commits

Author SHA1 Message Date
Zoltan Somogyi
3dc4babb24 Update the style of more test cases.
And update expected output files for changes in line numbers.
2021-07-27 13:29:46 +10:00
Zoltan Somogyi
fdd141bf77 Clean up the tests in the other test directories.
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
    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 tests
    that check compiler error messages, expect the new line numbers.

browser/cterm.m:
browser/tree234_cc.m:
    Import only one module per line.

tests/hard_coded/boyer.m:
    Fix something I missed.
2015-02-16 12:32:18 +11:00
Julien Fischer
73e40cd5e2 Make it an error for the (promised) purity of a foreign clause to disagree
Estimated hours taken: 6
Branches: main, release

Make it an error for the (promised) purity of a foreign clause to disagree
with the declared purity of the corresponding predicate or function
declaration.  We only perform this check in the absence of a
promise_{pure,semipure} pragma for the predicate or function.

Previously this situation was sometimes picked up by purity analysis but not
in all cases.  For example, if a predicate was declared impure but the
foreign_proc was promised pure it wasn't reported.  In that particular case
it was a problem because if the foreign_proc did not have any outputs, then
simplify.m might have optimised its body away (which is how I noticed this).

compiler/add_pramga.m:
	In the absence of promise_{pure,semipure} pragmas emit error messages
	about mismatches between the declared purity of a procedure and the
	(promised) purity of a foreign clause for it.

compiler/mode_errors.m:
	Fix a typo in an error message: s/becaise/because/

compiler/purity.m:
	Fix a bug reported by Ian. Inconsistent purity annotation were being
	treated as both a warning and an error.  Make it into an error.

library/private_builtin.m:
library/solutions.m:
	Delete bogus purity promises from foreign_proc attributes reported by
	the new check.

tests/invalid/Mmakefile:
tests/invalid/foreign_purity_mismatch.{m,err_exp}:
	Test case for the new error.

compiler/simplify.m:
compiler/prog_io_pragma.m:
	Fix some formatting.

tests/*/*:
	Fix purity errors picked up by the new check.
2006-07-10 04:41:00 +00:00
Peter Ross
4c71c5db87 Gets the tests in tests/invalid working in the il grade.
Estimated hours taken: 3
Branches: main

Gets the tests in tests/invalid working in the il grade.

compiler/options.m:
	Add a new developer option, --no-automatic-intermodule-optimization.
	This is used to turn off intermodule optimization in the
	tests/invalid directory so that the error messages are no
	longer generated during the --make-optimization-interface
	process.

compiler/handle_options.m:
	Test automatic-intermodule-optimization when determining
	whether to turn intermodule optimization on in the il grade.

tests/invalid/Mercury.options:
tests/invalid/purity/Mercury.options:
	Add --no-automatic-intermodule-optimization.

tests/invalid/foreign_singleton.err_exp2:
tests/invalid/foreign_type_2.err_exp2:
tests/invalid/pragma_c_code_dup_var.err_exp2:
tests/invalid/pragma_c_code_no_det.err_exp2:
	Add a second expected error message for non C backends.

tests/invalid/impure_method_impl.m:
tests/invalid/multimode_missing_impure.m:
tests/invalid/multimode_syntax.m:
tests/invalid/pragma_c_code_no_det.m:
tests/invalid/purity/impure_func_t2.m:
tests/invalid/purity/impure_func_t3.m:
tests/invalid/purity/impure_func_t4.m:
tests/invalid/purity/impure_func_t5.m:
tests/invalid/purity/impure_func_t7.m:
tests/invalid/purity/impure_pred_t1.m:
tests/invalid/purity/impure_pred_t2.m:
tests/invalid/purity/purity.m:
	Add Mercury implementations of foreign_code predicates.
2002-11-07 16:17:09 +00:00
Fergus Henderson
ce7a41620d Add some test cases for my recent change to add support
Estimated hours taken: 2
Branches: main

tests/hard_coded/Mmakefile:
tests/hard_coded/multimode.m:
tests/hard_coded/multimode.exp:
tests/invalid/Mmakefile:
tests/invalid/multimode_missing_impure.m:
tests/invalid/multimode_missing_impure.err_exp:
tests/invalid/multimode_dcg.m:
tests/invalid/multimode_dcg.err_exp:
tests/invalid/multimode_syntax.m:
tests/invalid/multimode_syntax.err_exp:
	Add some test cases for my recent change to add support
	for using different clauses for different modes.
2001-05-16 17:28:43 +00:00