mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-28 15:54:18 +00:00
Branches: main, 11.07 Fix a bug that causes the compiler to erroneously emit an error message about multiple foreign_enum pragmas when --intermodule-optimization is enabled. The problem only shows up with a particular arrangement of submodules and module imports -- illustrated in the test case -- it is caused by the fact that the foreign_enum pragma ends up in both the .int and .int0 file and the existing code for adding pragmas to the HLDS didn't take account of the fact that both might be present. compiler/add_pragma.m: Don't emit an error about duplicate foreign_enum pragmas if one of them is opt-imported. tests/hard_coded/sub-modules/Mmakefile: tests/hard_coded/sub-modules/Mercury.options: tests/hard_coded/sub-modules/g12_fe_bug*.m: tests/hard_coded/sub-modules/g12_fe_bug.exp: Add a regression test.
58 lines
1.2 KiB
Plaintext
58 lines
1.2 KiB
Plaintext
#-----------------------------------------------------------------------------#
|
|
#
|
|
# This directory contains test cases for sub-modules,
|
|
# including both nested modules and separate sub-modules.
|
|
#
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
THIS_DIR = hard_coded/sub-modules
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
#
|
|
# Note: currently these test cases do not reliabily pass
|
|
# if you use parallel make.
|
|
#
|
|
|
|
SUB_MODULE_PROGS= \
|
|
accessibility \
|
|
accessibility2 \
|
|
class \
|
|
deeply_nested \
|
|
finalise_parent \
|
|
g12_fe_bug \
|
|
initialise_parent \
|
|
mutable_parent \
|
|
nested \
|
|
nested2 \
|
|
nested3 \
|
|
nested_intermod_main \
|
|
non_word_mutable \
|
|
parent \
|
|
parent2 \
|
|
sm_exp_bug \
|
|
use_submodule
|
|
|
|
# Solver types only work in C grades
|
|
ifeq "$(filter il% csharp% java% erlang%,$(GRADE))" ""
|
|
SOLVER_PROGS = \
|
|
ts
|
|
else
|
|
SOLVER_PROGS =
|
|
endif
|
|
|
|
PROGS=$(SUB_MODULE_PROGS) $(SOLVER_PROGS)
|
|
|
|
TESTS = $(PROGS)
|
|
TESTS_DIR=../..
|
|
SUBDIRS=
|
|
include $(TESTS_DIR)/Mmake.common
|
|
|
|
# Module-specific options should go in Mercury.options so they
|
|
# can be found by `mmc --make'.
|
|
include Mercury.options
|
|
|
|
%.runtest: %.res ;
|
|
|
|
#-----------------------------------------------------------------------------#
|