summaryrefslogtreecommitdiff
path: root/tests/usr.bin/indent/psym_do_stmt.c
blob: 773fe8f53041bee0d0fc4dc34758a2b88f494b77 (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
29
30
31
/* $NetBSD: psym_do_stmt.c,v 1.4 2022/04/24 10:36:37 rillig Exp $ */

/*
 * Tests for the parser symbol psym_do_stmt, which represents the state after
 * reading the keyword 'do' and the loop body, now waiting for the keyword
 * 'while' and the controlling expression.
 */

//indent input
void function(void) {
	do stmt(); while (0);
	do { stmt(); } while (0);
	do /* comment */ stmt(); while (0);
}
//indent end

//indent run
void
function(void)
{
	do
		stmt();
	while (0);
	do {
		stmt();
	} while (0);
	do			/* comment */
		stmt();
	while (0);
}
//indent end