xref: /netbsd-src/tests/usr.bin/xlint/lint1/stmt_goto.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /*	$NetBSD: stmt_goto.c,v 1.2 2022/06/17 18:54:53 rillig Exp $	*/
2 # 3 "stmt_goto.c"
3 
4 /*
5  * Tests for the 'goto' statement.
6  */
7 
8 /* expect+1: error: syntax error 'goto' [249] */
9 goto invalid_at_top_level;
10 
11 void
12 function(void)
13 {
14 	goto label;
15 label:
16 	/* expect+1: error: syntax error '"' [249] */
17 	goto "string";
18 
19 	/* Reset the error handling of the parser. */
20 	goto ok;
21 ok:
22 
23 	/* Numeric labels work in Pascal, but not in C. */
24 	/* expect+1: error: syntax error '12345' [249] */
25 	goto 12345;
26 }
27