Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: test error recovery of...



details:   https://anonhg.NetBSD.org/src/rev/9a03e6bfcd69
branches:  trunk
changeset: 1022199:9a03e6bfcd69
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jul 08 20:11:15 2021 +0000

description:
tests/lint: test error recovery of the parser

diffstat:

 tests/usr.bin/xlint/lint1/msg_249.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 27543ff5609b -r 9a03e6bfcd69 tests/usr.bin/xlint/lint1/msg_249.c
--- a/tests/usr.bin/xlint/lint1/msg_249.c       Thu Jul 08 19:08:03 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_249.c       Thu Jul 08 20:11:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_249.c,v 1.4 2021/07/08 18:02:22 rillig Exp $       */
+/*     $NetBSD: msg_249.c,v 1.5 2021/07/08 20:11:15 rillig Exp $       */
 # 3 "msg_249.c"
 
 // Test for message: syntax error '%s' [249]
@@ -33,5 +33,15 @@
        );                      /* expect: syntax error ')' */
 }
 
+/* XXX: It is unexpected that this error is not detected. */
+"This syntax error is not detected.";
+
 /* XXX: This is necessary to recover the yacc parser. */
-int recover_from_rparen;
+double recover_from_rparen;
+
+/* Ensure that the declaration after the syntax error is processed. */
+double *
+access_declaration_after_syntax_error(void)
+{
+       return &recover_from_rparen;
+}



Home | Main Index | Thread Index | Old Index