[m-rev.] for review: Skip or delete tests that fail in low-level parallel grades.
Peter Wang
novalazy at gmail.com
Wed Nov 23 14:09:27 AEDT 2022
Should we delete the hard_coded/parse test as well? It seems more
trouble than it's worth.
---
Since the compiler now refuses to allow debugging in parallel grades,
tests that require debugging need to be skipped over in low-level
parallel grades or deleted.
tests/hard_coded/Mmakefile:
Disable 'parse' test in parallel grades as it happens to link with
debug libraries.
tests/par_conj/Mercury.options:
tests/par_conj/Mmakefile:
tests/par_conj/par_ddeath.exp:
tests/par_conj/par_ddeath.m:
tests/par_conj/par_ddeath_2.exp:
tests/par_conj/par_ddeath_2.m:
Delete par_ddeath and par_ddeath_2 tests that once triggered a
compiler abort with --trace deep in parallel grades.
I don't think there is much value in keeping them around.
tests/valid/Mmake.valid.common:
Skip LLDS_PROGS (i.e. test cases that required debugging) in
parallel grades.
tests/valid/Mercury.options:
tests/valid/Mmakefile:
tests/valid/untuple_bug.m:
Delete untuple_bug. It tests an old bug in the untupling
transformation, which was more a programming exercise than something
that should be used anyway.
---
tests/hard_coded/Mmakefile | 2 +-
tests/par_conj/Mercury.options | 5 ---
tests/par_conj/Mmakefile | 15 +--------
tests/par_conj/par_ddeath.exp | 1 -
tests/par_conj/par_ddeath.m | 37 ----------------------
tests/par_conj/par_ddeath_2.exp | 1 -
tests/par_conj/par_ddeath_2.m | 40 ------------------------
tests/valid/Mercury.options | 1 -
tests/valid/Mmake.valid.common | 34 ++++++++++++---------
tests/valid/Mmakefile | 3 +-
tests/valid/untuple_bug.m | 54 ---------------------------------
11 files changed, 23 insertions(+), 170 deletions(-)
delete mode 100644 tests/par_conj/par_ddeath.exp
delete mode 100644 tests/par_conj/par_ddeath.m
delete mode 100644 tests/par_conj/par_ddeath_2.exp
delete mode 100644 tests/par_conj/par_ddeath_2.m
delete mode 100644 tests/valid/untuple_bug.m
diff --git a/tests/hard_coded/Mmakefile b/tests/hard_coded/Mmakefile
index 04c0eb9dd..213a665d9 100644
--- a/tests/hard_coded/Mmakefile
+++ b/tests/hard_coded/Mmakefile
@@ -902,7 +902,7 @@ ifneq "$(findstring apple-darwin,$(FULLARCH))" "apple-darwin"
ifneq "$(findstring solaris,$(FULLARCH))" "solaris"
# The `parse' test also links with the debug libraries,
# so it only works in LLDS grades.
- ifeq "$(filter hl% csharp% java%,$(GRADE))" ""
+ ifeq "$(filter hl% csharp% java%,$(GRADE))$(findstring par,$(GRADE))" ""
STATIC_LINK_PROGS = parse
endif
endif
diff --git a/tests/par_conj/Mercury.options b/tests/par_conj/Mercury.options
index 1dc3d773a..1f6216b3b 100644
--- a/tests/par_conj/Mercury.options
+++ b/tests/par_conj/Mercury.options
@@ -1,10 +1,5 @@
MCFLAGS-dep_par_11d = --intermod-opt
-# These test cases are compiled with --trace deep because they are
-# regression tests for a bug that only shows up with deep tracing.
-MCFLAGS-par_ddeath = --trace deep
-MCFLAGS-par_ddeath_2 = --trace deep
-
MCFLAGS-dg_fib = --parallel --distance-granularity 10
MCFLAGS-dg_fib_func = --parallel --distance-granularity 10
diff --git a/tests/par_conj/Mmakefile b/tests/par_conj/Mmakefile
index 3f1936f75..bfaad5730 100644
--- a/tests/par_conj/Mmakefile
+++ b/tests/par_conj/Mmakefile
@@ -66,19 +66,6 @@ INDEP_PAR_CONJ_PROGS = \
par_fib \
threads_hang
-# These tests require debugging, which hasn't been implemented for
-# the MLDS backend.
-#
-LLDS_PROGS = \
- par_ddeath \
- par_ddeath_2
-
-ifeq "$(filter hl% java% csharp%,$(GRADE))" ""
- PROGS0 = $(LLDS_PROGS)
-else
- PROGS0 =
-endif
-
ifneq "$(findstring par,$(GRADE))" ""
# These tests are to do with explicit threads rather than parallel
# conjunction, but the tests require multiple engines to be enabled,
@@ -96,7 +83,7 @@ ifneq "$(findstring decldebug,$(GRADE))" ""
PROGS =
else
OBJ_PROGS =
- PROGS = $(PROGS0) $(DEP_PAR_CONJ_PROGS) $(INDEP_PAR_CONJ_PROGS) \
+ PROGS = $(DEP_PAR_CONJ_PROGS) $(INDEP_PAR_CONJ_PROGS) \
$(THREAD_PROGS)
endif
diff --git a/tests/par_conj/par_ddeath.exp b/tests/par_conj/par_ddeath.exp
deleted file mode 100644
index 29d6383b5..000000000
--- a/tests/par_conj/par_ddeath.exp
+++ /dev/null
@@ -1 +0,0 @@
-100
diff --git a/tests/par_conj/par_ddeath.m b/tests/par_conj/par_ddeath.m
deleted file mode 100644
index 50166a080..000000000
--- a/tests/par_conj/par_ddeath.m
+++ /dev/null
@@ -1,37 +0,0 @@
-%---------------------------------------------------------------------------%
-% vim: ts=4 sw=4 et ft=mercury
-%---------------------------------------------------------------------------%
-%
-% There was a problem with this file when --trace deep was used,
-% due to a bug in the --delay-death pass.
-% I'd made the delay death pass treat parallel conjunctions in
-% the same way as plain conjunctions, but that is all wrong
-% and causes this exception in the code generator.
-%
-% Uncaught Mercury exception:
-% Software Error: map.lookup: key not found
-% Key Type: term.var(parse_tree.prog_data.prog_var_type)
-% Key Value: var(6)
-% Value Type: ll_backend.var_locn.var_state
-
-:- module par_ddeath.
-:- interface.
-:- import_module io.
-:- pred main(io::di, io::uo) is det.
-
-:- implementation.
-:- import_module int.
-
-main(IO0, IO) :-
- (
- A = 100,
- (
- C = A
- &
- true
- )
- &
- true
- ),
- io.write_int(C, IO0, IO1),
- io.nl(IO1, IO).
diff --git a/tests/par_conj/par_ddeath_2.exp b/tests/par_conj/par_ddeath_2.exp
deleted file mode 100644
index a98ad067b..000000000
--- a/tests/par_conj/par_ddeath_2.exp
+++ /dev/null
@@ -1 +0,0 @@
-[0, 1, 2, 3, 4, 5]
diff --git a/tests/par_conj/par_ddeath_2.m b/tests/par_conj/par_ddeath_2.m
deleted file mode 100644
index b5aa499b8..000000000
--- a/tests/par_conj/par_ddeath_2.m
+++ /dev/null
@@ -1,40 +0,0 @@
-%---------------------------------------------------------------------------%
-% vim: ts=4 sw=4 et ft=mercury
-%---------------------------------------------------------------------------%
-%
-% With --trace deep --parallel
-% The incorrect deadness analysis of the parallel conjunction caused Result to
-% be added to the pre-death set of the else branch of the if-then-else.
-% When --delay-death is enabled (with --trace deep) it would result in the
-% following exception:
-%
-% Uncaught Mercury exception:
-% Software Error: liveness.m:
-% Unexpected: branches of if-then-else disagree on liveness
-% First: Low High Result
-% Rest: Low High
-
-:- module par_ddeath_2.
-:- interface.
-:- import_module io.
-:- pred main(io::di, io::uo) is det.
-
-:- implementation.
-
-:- import_module int.
-:- import_module list.
-
-main(!IO) :-
- integers(0, 5, R),
- io.print(R, !IO),
- io.nl(!IO).
-
-:- pred integers(int::in, int::in, list(int)::out) is det.
-
-integers(Low, High, Result) :-
- ( Low =< High ->
- integers(Low+1, High, Rest) &
- Result = [Low | Rest]
- ;
- Result = []
- ).
diff --git a/tests/valid/Mercury.options b/tests/valid/Mercury.options
index 041c47a5a..520c6b8ba 100644
--- a/tests/valid/Mercury.options
+++ b/tests/valid/Mercury.options
@@ -131,7 +131,6 @@ MCFLAGS-typeclass_det_warning = --halt-at-warn
MCFLAGS-type_inf_ambig_test = --infer-all
MCFLAGS-unify_typeinfo_bug = -O3
MCFLAGS-uniq_mode_inf_bug = --infer-all
-MCFLAGS-untuple_bug = -O0 --untuple --trace rep --trace-optimized
MCFLAGS-vn_float = -O5
MCFLAGS-zero_arity = --infer-modes
MGNUCFLAGS-reg_bug = --no-ansi
diff --git a/tests/valid/Mmake.valid.common b/tests/valid/Mmake.valid.common
index 8be3efeff..7b8e7cb67 100644
--- a/tests/valid/Mmake.valid.common
+++ b/tests/valid/Mmake.valid.common
@@ -38,10 +38,10 @@
# CTGC_PROGS:
# The test cases that only work in grades that support compile-time
# garbage collection. Debugging is incompatible with ctgc.
-# CONSTRAINT_TYPECHECK_PROGS::
+# CONSTRAINT_TYPECHECK_PROGS:
# Tests that use constraint based type checking.
# XXX These are never enabled.
-# NON_DECLDEBUG_PROGS::
+# NON_DECLDEBUG_PROGS:
# Test that do not work in .decldebug grades
# OTHER_PROGS:
# All the other test cases.
@@ -80,30 +80,36 @@ endif
ifeq "$(filter hl% java% csharp%,$(GRADE))" ""
PROGS4 = $(PROGS3) $(C_INTERFACE_PROGS) $(SOLVER_PROGS) \
- $(DEEP_PROF_CAPABLE_PROGS) $(LLDS_PROGS)
+ $(DEEP_PROF_CAPABLE_PROGS)
else
PROGS4 = $(PROGS3)
endif
-ifneq "$(findstring decldebug,$(GRADE))" ""
- PROGS5 = $(PROGS4)
+ifeq "$(filter hl% java% csharp%,$(GRADE))$(findstring par,$(GRADE))" ""
+ PROGS5 = $(PROGS4) $(LLDS_PROGS)
else
- PROGS5 = $(PROGS4) $(PAR_CONJ_PROGS)
+ PROGS5 = $(PROGS4)
+endif
+
+ifneq "$(findstring decldebug,$(GRADE))" ""
+ PROGS6 = $(PROGS5)
+else
+ PROGS6 = $(PROGS5) $(PAR_CONJ_PROGS)
endif
ifeq "$(findstring debug,$(GRADE))" ""
- PROGS6 = $(PROGS5) $(CTGC_PROGS)
-else
- PROGS6 = $(PROGS5)
-endif
-
-ifeq "$(filter hl% java% csharp%,$(GRADE))$(findstring decldebug,$(GRADE))" ""
- PROGS7 = $(PROGS6) $(NON_DECLDEBUG_PROGS)
+ PROGS7 = $(PROGS6) $(CTGC_PROGS)
else
PROGS7 = $(PROGS6)
endif
-OBJ_PROGS = $(PROGS7)
+ifeq "$(filter hl% java% csharp%,$(GRADE))$(findstring par,$(GRADE))$(findstring decldebug,$(GRADE))" ""
+ PROGS8 = $(PROGS7) $(NON_DECLDEBUG_PROGS)
+else
+ PROGS8 = $(PROGS7)
+endif
+
+OBJ_PROGS = $(PROGS8)
ifneq "$(findstring tsw,$(GRADE))$(findstring tsc,$(GRADE))" ""
PROGS = $(OBJ_PROGS) $(C_PROGS)
diff --git a/tests/valid/Mmakefile b/tests/valid/Mmakefile
index 1c3ad78f8..b8bc1a947 100644
--- a/tests/valid/Mmakefile
+++ b/tests/valid/Mmakefile
@@ -287,8 +287,7 @@ LLDS_PROGS = \
liveness_disagree \
liveness_ite \
livevars_shallow \
- livevars_shallow2 \
- untuple_bug
+ livevars_shallow2
TABLE_PROGS = \
bug36 \
diff --git a/tests/valid/untuple_bug.m b/tests/valid/untuple_bug.m
deleted file mode 100644
index 903dffb9b..000000000
--- a/tests/valid/untuple_bug.m
+++ /dev/null
@@ -1,54 +0,0 @@
-%---------------------------------------------------------------------------%
-% vim: ts=4 sw=4 et ft=mercury
-%---------------------------------------------------------------------------%
-%
-% Predicates generated by the untupling transformation were being given the
-% same forms of names, no matter if the original procedure being transformed
-% was a predicate or a function. If a module had a predicate and a function
-% with the same name and arity, and tracing was enabled, and a low enough
-% optimisation level was being used, this would result in an exception being
-% thrown.
-%
-% mmc -C -O0 --untuple --trace deep --trace-optimized untuple_bug.m
-%
-% Uncaught Mercury exception:
-% Software Error: map__det_insert: key already present
-% Key Type: ll_backend.llds.label
-% Key Value: internal(2, proc(unqualified("untuple_bug"), predicate,
-% unqualified("untuple_bug"), "untupling_0__pred__f__0__1", 1, 0))
-% Value Type: ll_backend.llds.data_addr
-%
-% A similar nameclash happened when two procedures of the same name but
-% different arities were expanded into procedures of the same arity.
-
-:- module untuple_bug.
-
-:- interface.
-
-:- type t ---> t(int).
-:- type tt ---> tt(int, int).
-
-% A function and predicate of the same name and arity.
-
-:- func f = t.
-:- pred f(t::out) is det.
-
-% Two predicates that expand into the same name and arity.
-
-:- pred g(t::in, t::in) is semidet.
-:- pred g(tt::in) is semidet.
-
-:- pred h(t::in, t::in) is semidet.
-:- pred h(tt::in) is semidet.
-
-:- implementation.
-
-f = t(0).
-f(t(0)).
-
-g(t(T), t(T)).
-g(tt(T, T)).
-
-% These are on the same line to make sure that a counter is being used
-% properly when generating names.
-h(t(T), t(T)). h(tt(T, T)).
--
2.38.0
More information about the reviews
mailing list