Files
mercury/tests/warnings/Mmakefile
Zoltan Somogyi 1457d825ee Fix more C# test failures.
tests/invalid_nodepend/Mercury.options:
tests/invalid_purity/Mercury.options:
    Let several test cases proceed to the compiler invocation we want to test.

tests/submodules/impl_def_literal.m:
    Comment out the atomic goal in this test case. (See below for the reason.)

tests/valid/big_foreign_type.m:
tests/valid/bug318.m:
tests/valid/flatten_conj_bug.m:
tests/valid/ho_and_type_spec_bug.m:
tests/valid/mert.m:
tests/valid/param_mode_bug.m:
    These test cases were missing C# definitions (and in some cases,
    Java definitions) of types and/or predicates. Add them.

tests/warnings/Mercury.options:
tests/warnings/Mmakefile:
    Update references to a not-long-ago renamed file.

tests/warnings/foreign_singleton.m:
    Add Java and C# definitions of some predicates.

tests/warnings/foreign_singleton.exp:
    Update the line numbers in the expected output for C.

tests/warnings/foreign_singleton.exp[23]:
    Add these expected output files for Java and C#.

compiler/simplify_goal.m:
    Generate an error message if we find an atomic goal
    but we are targeting a language which has no definitions
    for the primitive operations used in the implementation of such goals.
    Until now, for tests/submodules/impl_def_literal.m (which until now
    contained an atomic goal), the compiler would generate code that
    aborted at runtime. We report the problem, which avoids the generation
    of code that would abort.
2023-11-02 03:22:50 +11:00

160 lines
4.2 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
TESTS_DIR = ..
THIS_DIR = warnings
MAYBE_J1 =
#-----------------------------------------------------------------------------#
COMPILE_PROGS = \
arg_order_rearrangment \
foreign_term_invalid \
non_term_user_special \
pragma_term_conflict \
term_indirect_warning \
subtype_order \
warn_dead_procs \
warn_dead_procs_trace
ERRORCHECK_PROGS = \
abstract_type_decl \
ambiguous_overloading \
bug311 \
bug412 \
bug477 \
det_infer_warning \
disabled_warning \
double_underscore \
duplicate_call \
duplicate_const \
empty_interface \
foreign_singleton \
format_call_multi \
format_call_warning \
gh85 \
inconsistent_pred_order \
inf_recursion_lambda \
inference_test \
infinite_recursion \
inst_with_no_type \
missing_if \
missing_singleton_warning \
non_contiguous_decls \
non_stratification \
obsolete_proc_pragma \
occurs \
pragma_source_file \
purity_warnings \
save \
simple_code \
singleton_test \
singleton_test_state_var \
spurious_obsolete \
state_vars_test \
suspicious_foreign_code \
suspicious_recursion \
table_with_inline \
unify_f_g \
unify_x_f_x \
unknown_warning \
unneeded_mode_specific_clause \
unsigned_zero_cmp \
unused_args_test \
unused_import \
unused_interface_import \
warn_contiguous_foreign \
warn_non_contiguous \
warn_non_contiguous_foreign \
warn_non_contiguous_foreign_group \
warn_return \
warn_self_import \
warn_stubs \
warn_succ_ind
# We do not pass these two tests, which were intended to test the shadowing
# of standard library modules. Ironically, the reason why we compare the
# actual .err files of these test cases with their .exp files is that
# mmake finds what it thinks are *their* .err files in the stage2/library
# directory, and thus does not actually compile them. This leaves no .err
# file in *this* directory for the %.res_error rule to compare against
# the .exp file.
#
# profiling_builtin
# time
ifeq ($(MMAKE_USE_MMC_MAKE),yes)
ERRORCHECK_PROGS += unused_args_analysis
endif
PROGS = $(COMPILE_PROGS) $(ERRORCHECK_PROGS) up_to_date
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
# With `mmc --make', the errors should only go to the
# `.err' files, not stderr.
MCFLAGS += --output-compile-error-lines 0
MCFLAGS += --infer-all
$(COMPILE_PROGS:%=%.runtest): %.runtest: %.res_compile ;
$(ERRORCHECK_PROGS:%=%.runtest): %.runtest: %.res_error ;
# Build the `.analysis' file for unused_args_analysis_helper_1
# before building unused_args_analysis.c.
# XXX These dependencies are only for C.
unused_args_analysis.c: unused_args_analysis_helper_1.c
unused_args_analysis.err: unused_args_analysis_helper_1.c
# Check that `mmc --make up_to_date.m' generates a warning.
up_to_date.runtest:
$(MCM) up_to_date.m > up_to_date.err_make 2>&1
diff $(DIFF_OPTS) up_to_date.exp up_to_date.err_make \
> up_to_date.res_make || \
{ cat up_to_date.err_make; cat up_to_date.res_make; exit 1; }
#-----------------------------------------------------------------------------#
%.res_error: %.exp %.err
-rm -f $@
diff $(DIFF_OPTS) $*.exp $*.err > $@ || \
{ [ -f $*.exp2 ] && \
diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \
{ [ -f $*.exp3 ] && \
diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \
{ [ -f $*.exp4 ] && \
diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \
{ cat $*.err; cat $@; exit 1; }
%.res_compile: %.exp %.c
-rm -f $@
diff $(DIFF_OPTS) $*.exp $*.err > $@ || \
{ [ -f $*.exp2 ] && \
diff $(DIFF_OPTS) $*.exp2 $*.err > $@; } || \
{ [ -f $*.exp3 ] && \
diff $(DIFF_OPTS) $*.exp3 $*.err > $@; } || \
{ [ -f $*.exp4 ] && \
diff $(DIFF_OPTS) $*.exp4 $*.err > $@; } || \
{ cat $*.err; cat $@; exit 1; }
ifeq ($(MMAKE_USE_MMC_MAKE),yes)
%.c: %.m
$(MCM) $@ 2>&1 | grep -v "^Making" > $*.err
endif
#-----------------------------------------------------------------------------#
clean_local: clean_err clean_res
clean_err:
rm -f *.err up_to_date.err_make
#-----------------------------------------------------------------------------#