This commit fixes the asserts in a68_loer_char_mult3 so it expects
either int*char or char*int. It also expands the mult-char-1.a68
testcase to cover this case.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
* a68-low-prelude.cc (a68_lower_char_mult3): Fix asserts.
gcc/testsuite/ChangeLog
* algol68/execute/mult-char-1.a68: Cover int*char cases.
if (MOID (n1) == M_INT)
{
- gcc_assert (MOID (n2) == M_STRING || MOID (n2) == M_ROW_CHAR);
+ gcc_assert (MOID (n2) == M_CHAR);
return a68_string_mult (a68_string_from_char (a68_lower_tree (n2, ctx)),
a68_lower_tree (n1, ctx));
}
# { dg-options "-fstropping=upper" } #
BEGIN ASSERT ("a" * 3 = "aaa");
ASSERT ("" * 1 = "");
- ASSERT ("x" * 0 = "x")
+ ASSERT ("x" * 0 = "x");
+ ASSERT (3 * "a" = "aaa");
+ ASSERT (1 * "" = "");
+ ASSERT (0 * "x" = "x")
END