mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 11:23:46 +00:00
compiler/hlds_error_util.m:
When creating format_pieces identifying one procedure of a predicate
or function, use just the id of the predicate or function itself
if it has no other procedures. This avoids cluttering diagnostics
with irrelevant details.
Replace two separate functions that used to construct such ids with one.
The difference was that one got the actual arg modes from a pred_info,
while the other allowed the caller to supply any modes it wanted, but
all callers (except one) of the second variant got the arg modes
the exact same way the first variant did. The one exception got them
from the *declared* arg modes field of the pred_info, which was a bug,
because would have generated unusable output if the predicate or function
had no declared modes, and got all its modes by inference.
Put all the functions involved in all of the above into a logical order.
compiler/det_analysis.m:
compiler/det_report.m:
compiler/simplify_goal_call.m:
compiler/stratify.m:
Conform to the changes in hlds_error_util.m.
In some places, improve diagnostics in other ways as well.
tests/general/Mercury.options:
tests/general/Mmakefile:
tests/warnings/Mmakefile:
tests/warnings/petdr1.{m,err_exp}:
Move the petdr1 test case from general to warnings. This case
never generated any output; its intended use was to check for
the absence of a compiler abort in the generation of some warnings.
In its new home, it tests that *and* the texts of the warnings.
tests/invalid/bug150.err_exp:
tests/invalid/bug150_partial_color.err_exp:
tests/invalid/bug496.err_exp:
tests/invalid/det_atomic_goal_msgs.err_exp:
tests/invalid/det_errors.err_exp:
tests/invalid/det_errors_and_io.err_exp:
tests/invalid/det_errors_deep.err_exp:
tests/invalid/erroneous_throw_promise.err_exp:
tests/invalid/hawkins_mm_fail_reset.err_exp:
tests/invalid/ho_unique_error.err_exp:
tests/invalid/io_in_ite_cond.err_exp:
tests/invalid/loopcheck.err_exp:
tests/invalid/magicbox.err_exp:
tests/invalid/mostly_uniq_1.err_exp:
tests/invalid/mostly_uniq_2.err_exp:
tests/invalid/multisoln_func.err_exp:
tests/invalid/not_a_switch.err_exp:
tests/invalid/one_member.err_exp:
tests/invalid/pragma_c_code_no_det.err_exp:
tests/invalid/ref_to_implicit_comma.err_exp:
tests/invalid/ref_to_implicit_pred.err_exp:
tests/invalid/require_det_in_lambda.err_exp:
tests/invalid/require_scopes.err_exp:
tests/invalid/try_detism.err_exp:
tests/invalid/user_field_access_decl_override_1.err_exp:
tests/invalid_nodepend/invalid_main.err_exp:
tests/invalid_nodepend/occurs.err_exp:
tests/warnings/det_infer_warning.err_exp:
tests/warnings/non_stratification.err_exp:
tests/warnings/obsolete_proc_pragma.err_exp:
Expect the updated diagnostics.
142 lines
3.6 KiB
Makefile
142 lines
3.6 KiB
Makefile
#-----------------------------------------------------------------------------#
|
|
# vim: ts=8 sw=8 noexpandtab ft=make
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
TESTS_DIR = ..
|
|
THIS_DIR = general
|
|
MAYBE_J1 =
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Any program added here should also be added to the `.cvsignore' file.
|
|
|
|
ORDINARY_PROGS = \
|
|
arithmetic \
|
|
array_binsearch \
|
|
array_test \
|
|
base_string_to_int_test \
|
|
base_string_to_integer \
|
|
commit_bug_1 \
|
|
commit_bug_2 \
|
|
complex_failure \
|
|
det_complicated_unify_1 \
|
|
det_complicated_unify_2 \
|
|
determinism_inlining \
|
|
disj_disj \
|
|
dnf \
|
|
do_while \
|
|
double_error_1 \
|
|
double_error_2 \
|
|
duplicate_label \
|
|
fail_detism \
|
|
float_roundtrip \
|
|
float_test \
|
|
frameopt_mkframe_bug \
|
|
hello_again \
|
|
higher_order \
|
|
hlc_name_mangling \
|
|
ho_spec_branch_bug \
|
|
intermod_type \
|
|
io_foldl \
|
|
io_regression \
|
|
liveness_1 \
|
|
liveness_2 \
|
|
map_equal \
|
|
mode_inf \
|
|
mode_inf_bug \
|
|
mode_inference_reorder \
|
|
mu \
|
|
nasty_nondet \
|
|
nondet_disj \
|
|
nondet_ite_1 \
|
|
nondet_ite_2 \
|
|
nondet_ite_3 \
|
|
nondet_ite_4 \
|
|
nondetlive \
|
|
parse_list \
|
|
partition \
|
|
prune_switch \
|
|
read_dir_regression \
|
|
read_line_as_string \
|
|
semi_fail_in_non_ite \
|
|
semidet_lambda \
|
|
semidet_map \
|
|
set_test \
|
|
state_vars_tests \
|
|
state_vars_typeclasses \
|
|
string_foldl_substring \
|
|
string_foldr_substring \
|
|
string_format_special_floats \
|
|
string_format_test_1 \
|
|
string_format_test_2 \
|
|
string_format_test_3 \
|
|
string_replace \
|
|
string_test_1 \
|
|
string_test_2 \
|
|
string_to_float \
|
|
test_parsing_utils \
|
|
test_string_to_int_overflow \
|
|
test_univ \
|
|
unreachable \
|
|
unsafe_uniqueness
|
|
|
|
EXCEPTION_PROGS = \
|
|
environment \
|
|
map_corresponding \
|
|
unused_arg_determinism
|
|
|
|
# The problem for state_var_trace is lack of needed reordering by the
|
|
# unique mode system.
|
|
|
|
ifneq "$(findstring profdeep,$(GRADE))" ""
|
|
PROGS = $(ORDINARY_PROGS)
|
|
else
|
|
PROGS = $(ORDINARY_PROGS) $(EXCEPTION_PROGS)
|
|
endif
|
|
|
|
TESTS = $(sort $(PROGS))
|
|
include ../Mmake.common
|
|
|
|
# Module-specific options should go in Mercury.options so they can be found
|
|
# by `mmc --make'.
|
|
include Mercury.options
|
|
|
|
%.runtest: %.res ;
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
#
|
|
# Some test cases need special handling.
|
|
#
|
|
|
|
# string_format_test_2 and string_format_test_3 are expected to fail
|
|
# (string.format should call error/1 for these test cases)
|
|
# so we need to ignore the exit status; hence the leading `-'.
|
|
# Also we pipe the output through sed to avoid hard-coding
|
|
# dependencies on particular line numbers in the standard library
|
|
# source code.
|
|
string_format_test_2.out: string_format_test_2
|
|
-./string_format_test_2 2>&1 | \
|
|
sed -e 's/io.m:[0-9]*/io.m:NNNN/g' \
|
|
-e 's/string.m:[0-9]*/string.m:NNNN/g' \
|
|
-e 's/require.m:[0-9]*/require.m:NNNN/g' \
|
|
-e 's/exception.m:[0-9]*/exception.m:NNNN/g' \
|
|
-e '/at\ mercury/d' \
|
|
-e '/jmercury/d' \
|
|
| tr -d '\r' > string_format_test_2.out
|
|
|
|
string_format_test_3.out: string_format_test_3
|
|
-./string_format_test_3 2>&1 | \
|
|
sed -e 's/io.m:[0-9]*/io.m:NNNN/g' \
|
|
-e 's/string.m:[0-9]*/string.m:NNNN/g' \
|
|
-e 's/require.m:[0-9]*/require.m:NNNN/g' \
|
|
-e 's/exception.m:[0-9]*/exception.m:NNNN/g' \
|
|
-e '/at\ mercury/d' \
|
|
-e '/jmercury/d' \
|
|
| tr -d '\r' > string_format_test_3.out
|
|
|
|
# io_foldl `cat's its input to its output.
|
|
io_foldl.out: io_foldl io_foldl.exp
|
|
./io_foldl < io_foldl.exp > io_foldl.out 2>&1
|
|
|
|
#-----------------------------------------------------------------------------#
|