tests/lint: add test coverage for some parse errors

This commit is contained in:
rillig 2021-07-08 18:02:22 +00:00
parent c90ee0ee4a
commit fdd3710481
2 changed files with 25 additions and 2 deletions

View File

@ -1,8 +1,26 @@
/* $NetBSD: msg_249.c,v 1.3 2021/06/19 16:05:07 rillig Exp $ */
/* $NetBSD: msg_249.c,v 1.4 2021/07/08 18:02:22 rillig Exp $ */
# 3 "msg_249.c"
// Test for message: syntax error '%s' [249]
/*
* Cover the grammar rule 'top_level_declaration: error T_SEMI'.
*/
/* expect+1: syntax error '"' [249] */
"syntax error in top_level_declaration";
/* XXX: This is necessary to recover the yacc parser. */
int recover_from_semi;
/*
* Cover the grammar rule 'top_level_declaration: error T_RBRACE'.
*/
/* expect+1: syntax error '"' [249] */
"syntax error in top_level_declaration"}
/* XXX: This is necessary to recover the yacc parser. */
int recover_from_rbrace;
/*
* Before func.c 1.110 from 2021-06-19, lint ran into this:
* assertion "cstmt->c_kind == kind" failed in end_control_statement
@ -14,3 +32,6 @@ function(void)
;
); /* expect: syntax error ')' */
}
/* XXX: This is necessary to recover the yacc parser. */
int recover_from_rparen;

View File

@ -1 +1,3 @@
msg_249.c(15): error: syntax error ')' [249]
msg_249.c(10): error: syntax error '"' [249]
msg_249.c(19): error: syntax error '"' [249]
msg_249.c(33): error: syntax error ')' [249]