summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/parse_stmt_error.c
blob: b3812ada4430aefecb5e990bcbbda06bb640c908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*	$NetBSD: parse_stmt_error.c,v 1.3 2023/03/28 14:44:35 rillig Exp $	*/
# 3 "parse_stmt_error.c"

/*
 * Test parsing of errors in selection statements (if, switch).
 */

/* lint1-extra-flags: -X 351 */

void do_nothing(void);

void
cover_selection_statement_else(_Bool cond)
{
	if (cond)
		do_nothing();
	else
		/* expect+1: error: syntax error ']' [249] */
		];
}

void
cover_selection_statement_switch(int x)
{
	switch (x)
		/* expect+1: error: syntax error ']' [249] */
		];
}