xref: /netbsd-src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c (revision b2baa50111d645353fa30b4deab0f79d93650c8c)
1 /*	$NetBSD: parse_stmt_iter_error.c,v 1.3 2023/03/28 14:44:35 rillig Exp $	*/
2 # 3 "parse_stmt_iter_error.c"
3 
4 /*
5  * Test parsing of errors in iteration statements (while, do, for).
6  */
7 
8 /* lint1-extra-flags: -X 351 */
9 
10 void do_nothing(void);
11 
12 void
cover_iteration_statement_while(_Bool cond)13 cover_iteration_statement_while(_Bool cond)
14 {
15 	while (cond)
16 		/* expect+1: error: syntax error ']' [249] */
17 		];
18 }
19 
20 void
cover_iteration_statement_do(void)21 cover_iteration_statement_do(void)
22 {
23 	do
24 		/* expect+1: error: syntax error ']' [249] */
25 		];
26 }
27 
28 void
cover_iteration_statement_for(void)29 cover_iteration_statement_for(void)
30 {
31 	for (int i = 0; i < 10; i++)
32 		/* expect+1: error: syntax error ']' [249] */
33 		];
34 }
35