[COMMITTED] a68: emit stropping-aware keywords and modes in diagnostics
Jose E. Marchesi
jemarch@gnu.org
Sat Oct 25 10:56:23 GMT 2025
This commit makes the front-end to take stropping into account when
emitting bold words in diagnostics.
For example, in supper stropping:
foo.a68:2:7: error: ‘[] char’ cannot be coerced to ‘flex [] int’ in a strong-unit
2 | j := "joo"
| ^
And in upper stroppping:
foo.a68:2:7: error: ‘[] CHAR’ cannot be coerced to ‘FLEX [] INT’ in a strong-unit
2 | j := "joo"
| ^
---
gcc/algol68/a68-diagnostics.cc | 4 +-
gcc/algol68/a68-moids-to-string.cc | 110 +++++++++++++-----
gcc/algol68/a68-parser-brackets.cc | 18 ++-
gcc/algol68/a68-parser-keywords.cc | 17 +++
gcc/algol68/a68-parser-top-down.cc | 13 ++-
gcc/algol68/a68.h | 1 +
.../compile/error-mode-stropping-1.a68 | 3 +
.../compile/error-mode-stropping-10.a68 | 3 +
.../compile/error-mode-stropping-11.a68 | 4 +
.../compile/error-mode-stropping-12.a68 | 3 +
.../compile/error-mode-stropping-13.a68 | 4 +
.../compile/error-mode-stropping-14.a68 | 3 +
.../compile/error-mode-stropping-15.a68 | 4 +
.../compile/error-mode-stropping-16.a68 | 3 +
.../compile/error-mode-stropping-17.a68 | 4 +
.../compile/error-mode-stropping-2.a68 | 4 +
.../compile/error-mode-stropping-3.a68 | 3 +
.../compile/error-mode-stropping-4.a68 | 4 +
.../compile/error-mode-stropping-5.a68 | 3 +
.../compile/error-mode-stropping-6.a68 | 4 +
.../compile/error-mode-stropping-8.a68 | 3 +
.../compile/error-mode-stropping-9.a68 | 4 +
.../algol68/compile/error-stropping-5.a68 | 3 +
.../algol68/compile/error-stropping-6.a68 | 4 +
.../compile/error-stropping-keyword-1.a68 | 2 +
.../compile/error-stropping-keyword-2.a68 | 3 +
.../compile/error-stropping-keyword-3.a68 | 2 +
.../compile/error-stropping-keyword-4.a68 | 3 +
28 files changed, 197 insertions(+), 39 deletions(-)
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-1.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-10.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-11.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-12.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-13.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-14.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-15.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-16.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-17.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-2.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-3.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-4.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-5.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-6.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-8.a68
create mode 100644 gcc/testsuite/algol68/compile/error-mode-stropping-9.a68
create mode 100644 gcc/testsuite/algol68/compile/error-stropping-5.a68
create mode 100644 gcc/testsuite/algol68/compile/error-stropping-6.a68
create mode 100644 gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68
create mode 100644 gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68
create mode 100644 gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68
create mode 100644 gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68
diff --git a/gcc/algol68/a68-diagnostics.cc b/gcc/algol68/a68-diagnostics.cc
index 907b5ec65e1..70ddf0afcdf 100644
--- a/gcc/algol68/a68-diagnostics.cc
+++ b/gcc/algol68/a68-diagnostics.cc
@@ -105,8 +105,10 @@ diagnostic (int sev, int opt,
KEYWORD_T *nt = a68_find_keyword_from_attribute (A68 (top_keyword), att);
if (nt != NO_KEYWORD)
{
+ char *strop_keyword = a68_strop_keyword (TEXT (nt));
+
obstack_grow (&b, "%<", 2);
- obstack_grow (&b, TEXT (nt), strlen (TEXT (nt)));
+ obstack_grow (&b, strop_keyword, strlen (strop_keyword));
obstack_grow (&b, "%>", 2);
}
else
diff --git a/gcc/algol68/a68-moids-to-string.cc b/gcc/algol68/a68-moids-to-string.cc
index 6d079040112..743f98d2590 100644
--- a/gcc/algol68/a68-moids-to-string.cc
+++ b/gcc/algol68/a68-moids-to-string.cc
@@ -89,6 +89,26 @@ pack_to_string (char *b, PACK_T *p, size_t *w, bool text, NODE_T *idf,
static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
bool indicant_value)
{
+ bool supper_stropping = (OPTION_STROPPING (&A68_JOB) == SUPPER_STROPPING);
+ const char *strop_self = supper_stropping ? "self" : "SELF";
+ const char *strop_hip = supper_stropping ? "hip" : "HIP";
+ const char *strop_compl = supper_stropping ? "compl" : "COMPL";
+ const char *strop_long_compl = supper_stropping ? "long compl" : "LONG COMPL";
+ const char *strop_long_long_compl = supper_stropping ? "long long compl" : "LONG LONG COMPL";
+ const char *strop_string = supper_stropping ? "string" : "STRING";
+ const char *strop_collitem = supper_stropping ? "collitem" : "COLLITEM";
+ const char *strop_simplin = supper_stropping ? "%%<simplin%%>" : "%%<SIMPLIN%%>";
+ const char *strop_simplout = supper_stropping ? "%%<simplout%%>" : "%%<SIMPLOUT%%>";
+ const char *strop_rows = supper_stropping ? "%%<rows%%>" : "%%<ROWS%%>";
+ const char *strop_vacuum = supper_stropping ? "%%<vacuum%%>" : "%%<VACUUM%%>";
+ const char *strop_long = supper_stropping ? "long" : "LONG";
+ const char *strop_short = supper_stropping ? "short" : "SHORT";
+ const char *strop_ref = supper_stropping ? "ref" : "REF";
+ const char *strop_flex = supper_stropping ? "flex" : "FLEX";
+ const char *strop_struct = supper_stropping ? "struct" : "STRUCT";
+ const char *strop_union = supper_stropping ? "union" : "UNION";
+ const char *strop_proc = supper_stropping ? "proc" : "PROC";
+
if (n == NO_MOID)
{
/* Oops. Should not happen. */
@@ -99,7 +119,7 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
/* Reference to self through REF or PROC. */
if (a68_is_postulated (A68 (postulates), n))
{
- add_to_moid_text (b, "SELF", w);
+ add_to_moid_text (b, strop_self, w);
return;
}
@@ -120,7 +140,7 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
/* Write the standard modes. */
if (n == M_HIP)
- add_to_moid_text (b, "HIP", w);
+ add_to_moid_text (b, strop_hip, w);
else if (n == M_ERROR)
add_to_moid_text (b, "ERROR", w);
else if (n == M_UNDEFINED)
@@ -128,23 +148,23 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
else if (n == M_C_STRING)
add_to_moid_text (b, "C-STRING", w);
else if (n == M_COMPLEX)
- add_to_moid_text (b, "COMPL", w);
+ add_to_moid_text (b, strop_compl, w);
else if (n == M_LONG_COMPLEX)
- add_to_moid_text (b, "LONG COMPL", w);
+ add_to_moid_text (b, strop_long_compl, w);
else if (n == M_LONG_LONG_COMPLEX)
- add_to_moid_text (b, "LONG LONG COMPL", w);
+ add_to_moid_text (b, strop_long_long_compl, w);
else if (n == M_STRING)
- add_to_moid_text (b, "STRING", w);
+ add_to_moid_text (b, strop_string, w);
else if (n == M_COLLITEM)
- add_to_moid_text (b, "COLLITEM", w);
+ add_to_moid_text (b, strop_collitem, w);
else if (IS (n, IN_TYPE_MODE))
- add_to_moid_text (b, "\"SIMPLIN\"", w);
+ add_to_moid_text (b, strop_simplin, w);
else if (IS (n, OUT_TYPE_MODE))
- add_to_moid_text (b, "\"SIMPLOUT\"", w);
+ add_to_moid_text (b, strop_simplout, w);
else if (IS (n, ROWS_SYMBOL))
- add_to_moid_text (b, "\"ROWS\"", w);
+ add_to_moid_text (b, strop_rows, w);
else if (n == M_VACUUM)
- add_to_moid_text (b, "\"VACUUM\"", w);
+ add_to_moid_text (b, strop_vacuum, w);
else if (IS (n, VOID_SYMBOL) || IS (n, STANDARD) || IS (n, INDICANT))
{
if (DIM (n) > 0)
@@ -154,8 +174,14 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
if ((*w) >= k * strlen ("LONG ") + strlen (NSYMBOL (NODE (n))))
{
while (k--)
- add_to_moid_text (b, "LONG ", w);
- add_to_moid_text (b, NSYMBOL (NODE (n)), w);
+ {
+ add_to_moid_text (b, strop_long, w);
+ add_to_moid_text (b, " ", w);
+ }
+
+ char *strop_symbol = a68_strop_keyword (NSYMBOL (NODE (n)));
+ add_to_moid_text (b, strop_symbol, w);
+ free (strop_symbol);
}
else
add_to_moid_text (b, "..", w);
@@ -167,14 +193,24 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
if ((*w) >= k * strlen ("SHORT ") + strlen (NSYMBOL (NODE (n))))
{
while (k--)
- add_to_moid_text (b, "SHORT ", w);
- add_to_moid_text (b, NSYMBOL (NODE (n)), w);
+ {
+ add_to_moid_text (b, strop_short, w);
+ add_to_moid_text (b, " ", w);
+ }
+
+ char *strop_symbol = a68_strop_keyword (NSYMBOL (NODE (n)));
+ add_to_moid_text (b, strop_symbol, w);
+ free (strop_symbol);
}
else
add_to_moid_text (b, "..", w);
}
else if (DIM (n) == 0)
- add_to_moid_text (b, NSYMBOL (NODE (n)), w);
+ {
+ char *strop_symbol = a68_strop_keyword (NSYMBOL (NODE (n)));
+ add_to_moid_text (b, strop_symbol, w);
+ free (strop_symbol);
+ }
/* Write compxounded modes. */
}
@@ -182,21 +218,29 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
{
if ((*w) >= strlen ("REF .."))
{
- add_to_moid_text (b, "REF ", w);
+ add_to_moid_text (b, strop_ref, w);
+ add_to_moid_text (b, " ", w);
moid_to_string_2 (b, SUB (n), w, idf, indicant_value);
}
else
- add_to_moid_text (b, "REF ..", w);
+ {
+ add_to_moid_text (b, strop_ref, w);
+ add_to_moid_text (b, " ..", w);
+ }
}
else if (IS_FLEX (n))
{
if ((*w) >= strlen ("FLEX .."))
{
- add_to_moid_text (b, "FLEX ", w);
+ add_to_moid_text (b, strop_flex, w);
+ add_to_moid_text (b, " ", w);
moid_to_string_2 (b, SUB (n), w, idf, indicant_value);
}
else
- add_to_moid_text (b, "FLEX ..", w);
+ {
+ add_to_moid_text (b, strop_flex, w);
+ add_to_moid_text (b, " ..", w);
+ }
}
else if (IS_ROW (n))
{
@@ -233,7 +277,8 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
{
POSTULATE_T *save = A68 (postulates);
a68_make_postulate (&A68 (postulates), n, NO_MOID);
- add_to_moid_text (b, "STRUCT (", w);
+ add_to_moid_text (b, strop_struct, w);
+ add_to_moid_text (b, " (", w);
pack_to_string (b, PACK (n), w, true, idf, indicant_value);
add_to_moid_text (b, ")", w);
a68_free_postulate_list (A68 (postulates), save);
@@ -242,7 +287,8 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
else
{
size_t k = DIM (n);
- add_to_moid_text (b, "STRUCT (", w);
+ add_to_moid_text (b, strop_struct, w);
+ add_to_moid_text (b, " (", w);
while (k-- > 0)
add_to_moid_text (b, ",", w);
add_to_moid_text (b, ")", w);
@@ -257,7 +303,8 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
{
POSTULATE_T *save = A68 (postulates);
a68_make_postulate (&A68 (postulates), n, NO_MOID);
- add_to_moid_text (b, "UNION (", w);
+ add_to_moid_text (b, strop_union, w);
+ add_to_moid_text (b, " (", w);
pack_to_string (b, PACK (n), w, false, idf, indicant_value);
add_to_moid_text (b, ")", w);
a68_free_postulate_list (A68 (postulates), save);
@@ -266,7 +313,8 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
else
{
size_t k = DIM (n);
- add_to_moid_text (b, "UNION (", w);
+ add_to_moid_text (b, strop_union, w);
+ add_to_moid_text (b, " (", w);
while (k-- > 0)
add_to_moid_text (b, ",", w);
add_to_moid_text (b, ")", w);
@@ -276,11 +324,15 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
{
if ((*w) >= strlen ("PROC .."))
{
- add_to_moid_text (b, "PROC ", w);
+ add_to_moid_text (b, strop_proc, w);
+ add_to_moid_text (b, " ", w);
moid_to_string_2 (b, SUB (n), w, idf, indicant_value);
}
else
- add_to_moid_text (b, "PROC ..", w);
+ {
+ add_to_moid_text (b, strop_proc, w);
+ add_to_moid_text (b, " ..", w);
+ }
}
else if (IS (n, PROC_SYMBOL) && DIM (n) > 0)
{
@@ -291,7 +343,8 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
{
POSTULATE_T *save = A68 (postulates);
a68_make_postulate (&A68 (postulates), n, NO_MOID);
- add_to_moid_text (b, "PROC (", w);
+ add_to_moid_text (b, strop_proc, w);
+ add_to_moid_text (b, " (", w);
pack_to_string (b, PACK (n), w, false, idf, indicant_value);
add_to_moid_text (b, ") ", w);
moid_to_string_2 (b, SUB (n), w, idf, indicant_value);
@@ -302,7 +355,8 @@ static void moid_to_string_2 (char *b, MOID_T *n, size_t *w, NODE_T *idf,
{
size_t k = DIM (n);
- add_to_moid_text (b, "PROC (", w);
+ add_to_moid_text (b, strop_proc, w);
+ add_to_moid_text (b, " (", w);
while (k-- > 0)
add_to_moid_text (b, ",", w);
add_to_moid_text (b, ") ..", w);
diff --git a/gcc/algol68/a68-parser-brackets.cc b/gcc/algol68/a68-parser-brackets.cc
index cd13e0c8a42..2aaa77024ec 100644
--- a/gcc/algol68/a68-parser-brackets.cc
+++ b/gcc/algol68/a68-parser-brackets.cc
@@ -30,7 +30,7 @@
stabilises later parser phases.
Note that this checker operates on a linear list of nodes.
-
+
Error diagnostics are placed near offending lines. */
/* Intelligible diagnostics for the bracket checker. */
@@ -43,11 +43,17 @@ bracket_check_error (char *txt, int n, const char *bra, const char *ket)
if (n == 0)
return;
+ char *strop_ket = a68_strop_keyword (ket);
+ char *strop_bra = a68_strop_keyword (bra);
+
BUFCLR (buf);
- if (snprintf (buf, SNPRINTF_SIZE, "\"%s\" without matching \"%s\"",
- (n > 0 ? bra : ket), (n > 0 ? ket : bra)) < 0)
+ if (snprintf (buf, SNPRINTF_SIZE, "missing matching %%<%s%%>",
+ (n > 0 ? strop_ket : strop_bra)) < 0)
gcc_unreachable ();
+ free (strop_ket);
+ free (strop_bra);
+
if (strlen (txt) > 0)
a68_bufcat (txt, " or ", BUFFER_SIZE);
a68_bufcat (txt, buf, BUFFER_SIZE);
@@ -197,9 +203,9 @@ bracket_check_parse (NODE_T *top, NODE_T *p)
else
{
char *diag = bracket_check_diagnose (top);
- a68_error (p, "encountered X L but expected X, check for Y",
- ATTRIBUTE (q), LINE (INFO (q)),
- ket, (strlen (diag) > 0 ? diag : "missing or unmatched keyword"));
+ a68_error (q, "unexpected X, check for Y",
+ ATTRIBUTE (q),
+ (strlen (diag) > 0 ? diag : "missing or unmatched keyword"));
longjmp (A68_PARSER (top_down_crash_exit), 1);
}
}
diff --git a/gcc/algol68/a68-parser-keywords.cc b/gcc/algol68/a68-parser-keywords.cc
index d1ee12bb3b8..ed7cceba6b1 100644
--- a/gcc/algol68/a68-parser-keywords.cc
+++ b/gcc/algol68/a68-parser-keywords.cc
@@ -25,6 +25,23 @@
#include "a68.h"
+/* Apply stropping to the given keyword and return its written form, which must
+ be upper-case. */
+
+char *
+a68_strop_keyword (const char *keyword)
+{
+ char *stropped = xstrdup (keyword);
+
+ if (OPTION_STROPPING (&A68_JOB) == SUPPER_STROPPING)
+ {
+ for (char *p = stropped; *p; ++p)
+ *p = TOLOWER (*p);
+ }
+
+ return stropped;
+}
+
/* Add token to the token tree. */
TOKEN_T *
diff --git a/gcc/algol68/a68-parser-top-down.cc b/gcc/algol68/a68-parser-top-down.cc
index cfb4ae7ceca..da20bd5982f 100644
--- a/gcc/algol68/a68-parser-top-down.cc
+++ b/gcc/algol68/a68-parser-top-down.cc
@@ -102,8 +102,10 @@ a68_phrase_to_text (NODE_T * p, NODE_T ** w)
{
if (gatt == IDENTIFIER || gatt == OPERATOR || gatt == DENOTATION)
{
- if (snprintf (A68 (edit_line), SNPRINTF_SIZE, " \"%s\"", NSYMBOL (p)) < 0)
+ char *strop_symbol = a68_strop_keyword (NSYMBOL (p));
+ if (snprintf (A68 (edit_line), SNPRINTF_SIZE, " %%<%s%%>", strop_symbol) < 0)
gcc_unreachable ();
+ free (strop_symbol);
a68_bufcat (buffer, A68 (edit_line), BUFFER_SIZE);
}
else
@@ -120,13 +122,16 @@ a68_phrase_to_text (NODE_T * p, NODE_T ** w)
}
else if (z != NO_TEXT && SUB (p) == NO_NODE)
{
- if (snprintf (A68 (edit_line), SNPRINTF_SIZE, " \"%s\"", NSYMBOL (p)) < 0)
+ char *strop_symbol = a68_strop_keyword (NSYMBOL (p));
+ if (snprintf (A68 (edit_line), SNPRINTF_SIZE, " %%<%s%%>", strop_symbol) < 0)
gcc_unreachable ();
+ free (strop_symbol);
a68_bufcat (buffer, A68 (edit_line), BUFFER_SIZE);
}
else if (NSYMBOL (p) != NO_TEXT)
{
- if (snprintf (A68 (edit_line), SNPRINTF_SIZE, " \"%s\"", NSYMBOL (p)) < 0)
+ char *strop_symbol = a68_strop_keyword (NSYMBOL (p));
+ if (snprintf (A68 (edit_line), SNPRINTF_SIZE, " %%<%s%%>", strop_symbol) < 0)
gcc_unreachable ();
a68_bufcat (buffer, A68 (edit_line), BUFFER_SIZE);
}
@@ -653,7 +658,7 @@ top_down_case (NODE_T *case_p)
return NEXT (case_p);
}
}
-
+
if (ouse_p != NO_NODE && IS (ouse_p, OUSE_SYMBOL))
{
NODE_T *esac_p = top_down_case (ouse_p);
diff --git a/gcc/algol68/a68.h b/gcc/algol68/a68.h
index 11c99b541a8..3c7804e70df 100644
--- a/gcc/algol68/a68.h
+++ b/gcc/algol68/a68.h
@@ -302,6 +302,7 @@ void a68_elaborate_bold_tags (NODE_T *p);
/* a68-parser-keywords.cc */
+char *a68_strop_keyword (const char *keyword);
void a68_set_up_tables (void);
TOKEN_T *a68_add_token (TOKEN_T **p, const char *t);
KEYWORD_T *a68_find_keyword (KEYWORD_T *p, const char *t);
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-1.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-1.a68
new file mode 100644
index 00000000000..7a619d8408f
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-1.a68
@@ -0,0 +1,3 @@
+begin struct (int i, real r) j;
+ j := "joo" { dg-error "char.*struct \\(int i, real r\\)" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-10.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-10.a68
new file mode 100644
index 00000000000..fd70de7df0d
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-10.a68
@@ -0,0 +1,3 @@
+begin long long int j;
+ j := "joo" { dg-error "char.*long long int" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-11.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-11.a68
new file mode 100644
index 00000000000..156d8d39aa6
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-11.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN LONG LONG INT j;
+ j := "joo" { dg-error "CHAR.*LONG LONG INT" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-12.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-12.a68
new file mode 100644
index 00000000000..0dda5beb414
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-12.a68
@@ -0,0 +1,3 @@
+begin short int j;
+ j := "joo" { dg-error "char.*short int" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-13.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-13.a68
new file mode 100644
index 00000000000..84cf830e7ec
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-13.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN SHORT INT j;
+ j := "joo" { dg-error "CHAR.*SHORT INT" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-14.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-14.a68
new file mode 100644
index 00000000000..24bda0a6db9
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-14.a68
@@ -0,0 +1,3 @@
+begin short short int j;
+ j := "joo" { dg-error "char.*short short int" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-15.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-15.a68
new file mode 100644
index 00000000000..0136fdb4f7b
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-15.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN SHORT SHORT INT j;
+ j := "joo" { dg-error "CHAR.*SHORT SHORT INT" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-16.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-16.a68
new file mode 100644
index 00000000000..82359e52d95
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-16.a68
@@ -0,0 +1,3 @@
+begin flex[1:0]int j;
+ j := "joo" { dg-error "char.*flex.*int" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-17.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-17.a68
new file mode 100644
index 00000000000..e733c51c75f
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-17.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN FLEX[1:0]INT j;
+ j := "joo" { dg-error "CHAR.*FLEX.*INT" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-2.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-2.a68
new file mode 100644
index 00000000000..f72b6dd1368
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-2.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN STRUCT (INT i, REAL r) j;
+ j := "joo" # { dg-error "CHAR.*STRUCT \\(INT i, REAL r\\)" } #
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-3.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-3.a68
new file mode 100644
index 00000000000..eb672c49533
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-3.a68
@@ -0,0 +1,3 @@
+begin union (int,real) j;
+ j := "joo" { dg-error "char.*union \\( *real *, *int *\\)" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-4.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-4.a68
new file mode 100644
index 00000000000..42c6ee29b6d
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-4.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN UNION (INT,REAL) j;
+ j := "joo" { dg-error "CHAR.*UNION \\( *REAL *, *INT *\\)" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-5.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-5.a68
new file mode 100644
index 00000000000..0206d19f72f
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-5.a68
@@ -0,0 +1,3 @@
+begin proc union (int,real) j;
+ j := "joo" { dg-error "char.*proc union \\( *real *, *int *\\)" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-6.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-6.a68
new file mode 100644
index 00000000000..5f8404363dd
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-6.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN PROC UNION (INT,REAL) j;
+ j := "joo" { dg-error "CHAR.*PROC UNION \\( *REAL *, *INT *\\)" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-8.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-8.a68
new file mode 100644
index 00000000000..49308860381
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-8.a68
@@ -0,0 +1,3 @@
+begin long int j;
+ j := "joo" { dg-error "char.*long int" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-mode-stropping-9.a68 b/gcc/testsuite/algol68/compile/error-mode-stropping-9.a68
new file mode 100644
index 00000000000..dc20eb34a34
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-mode-stropping-9.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN LONG INT j;
+ j := "joo" { dg-error "CHAR.*LONG INT" }
+END
diff --git a/gcc/testsuite/algol68/compile/error-stropping-5.a68 b/gcc/testsuite/algol68/compile/error-stropping-5.a68
new file mode 100644
index 00000000000..3190472129a
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-stropping-5.a68
@@ -0,0 +1,3 @@
+begin int j;
+ j := "joo" { dg-error "char.*int" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-stropping-6.a68 b/gcc/testsuite/algol68/compile/error-stropping-6.a68
new file mode 100644
index 00000000000..af6097df7c0
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-stropping-6.a68
@@ -0,0 +1,4 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN INT j;
+ j := "joo" # { dg-error "CHAR.*INT" } #
+END
diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68
new file mode 100644
index 00000000000..4bf549f91e3
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-1.a68
@@ -0,0 +1,2 @@
+begin for i to 10 skip od { dg-error "do" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68
new file mode 100644
index 00000000000..a1e616deaeb
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-2.a68
@@ -0,0 +1,3 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN FOR i TO 10 SKIP OD # { dg-error "DO" } #
+END
diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68
new file mode 100644
index 00000000000..d1076e935bd
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-3.a68
@@ -0,0 +1,2 @@
+begin if then 10 else 20 fi { dg-error "if" }
+end
diff --git a/gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68 b/gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68
new file mode 100644
index 00000000000..92b0b3b58cb
--- /dev/null
+++ b/gcc/testsuite/algol68/compile/error-stropping-keyword-4.a68
@@ -0,0 +1,3 @@
+# { dg-options "-fstropping=upper" } #
+BEGIN IF THEN 10 ELSE 20 FI # { dg-error "IF" } #
+END
--
2.30.2
More information about the Algol68
mailing list