[m-rev.] diff: Fix test failures with intermodule optimisation.

Peter Wang novalazy at gmail.com
Wed May 5 12:25:49 AEST 2021


tests/invalid/Mmakefile:
    Add type_error_use_module to list of REDIRECT_OPT_ERROR_MODULES
    as it produces error messages while making the .opt file.

tests/invalid/multiply_star.m:
    Add description of .err_exp files.

tests/invalid/multiply_star.err_exp:
    Update line numbers.

tests/invalid/multiply_star.err_exp2:
    Add expected error output when compiling with intermodule
    optimisation.

diff --git a/tests/invalid/Mmakefile b/tests/invalid/Mmakefile
index 999eaff11..1397f0582 100644
--- a/tests/invalid/Mmakefile
+++ b/tests/invalid/Mmakefile
@@ -608,7 +608,8 @@ REDIRECT_OPT_ERROR_MODULES = \
 	bug521 \
 	bug521_sub \
 	int_impl_imports \
-	test_feature_set
+	test_feature_set \
+	type_error_use_module
 endif
 
 define OVERRIDE_OPT_RULE
diff --git a/tests/invalid/multiply_star.err_exp b/tests/invalid/multiply_star.err_exp
index cae043c96..f45754475 100644
--- a/tests/invalid/multiply_star.err_exp
+++ b/tests/invalid/multiply_star.err_exp
@@ -1,2 +1,2 @@
-multiply_star.m:020: In clause for predicate `p'/2:
-multiply_star.m:020:   error: undefined symbol `*'/2.
+multiply_star.m:022: In clause for predicate `p'/2:
+multiply_star.m:022:   error: undefined symbol `*'/2.
diff --git a/tests/invalid/multiply_star.err_exp2 b/tests/invalid/multiply_star.err_exp2
new file mode 100644
index 000000000..b30cf5883
--- /dev/null
+++ b/tests/invalid/multiply_star.err_exp2
@@ -0,0 +1,7 @@
+multiply_star.m:022: In clause for predicate `p'/2:
+multiply_star.m:022:   error: undefined symbol `*'/2.
+multiply_star.m:022:   That symbol is defined in modules `int', `int16',
+multiply_star.m:022:   `int32', `int64', `int8', `uint', `uint16', `uint32',
+multiply_star.m:022:   `uint64' and `uint8', none of which have
+multiply_star.m:022:   `:- import_module' declarations.
+For more information, recompile with `-E'.
diff --git a/tests/invalid/multiply_star.m b/tests/invalid/multiply_star.m
index 242d1d303..13e0f6731 100644
--- a/tests/invalid/multiply_star.m
+++ b/tests/invalid/multiply_star.m
@@ -2,6 +2,8 @@
 % vim: ts=4 sw=4 et ft=mercury
 %---------------------------------------------------------------------------%
 %
+% The .exp file file is for compiling without intermodule optimization.
+% The .err_exp2 file is for compiling with intermodule optimization.
 
 :- module multiply_star.
 
-- 
2.30.0



More information about the reviews mailing list