xref: /netbsd-src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c (revision 53b02e147d4ed531c0d2a5ca9b3e8026ba3e99b5)
1 /*	$NetBSD: parse_stmt_iter_error.c,v 1.1 2021/07/25 09:29:20 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 void do_nothing(void);
9 
10 void
11 cover_iteration_statement_while(_Bool cond)
12 {
13 	while (cond)
14 		/* expect+1: syntax error ']' [249] */
15 		];
16 }
17 
18 void
19 cover_iteration_statement_do(void)
20 {
21 	do
22 		/* expect+1: syntax error ']' [249] */
23 		];
24 }
25 
26 void
27 cover_iteration_statement_for(void)
28 {
29 	for (int i = 0; i < 10; i++)
30 		/* expect+1: syntax error ']' [249] */
31 		];
32 }
33