xref: /netbsd-src/tests/usr.bin/indent/psym_do_stmt.c (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
1 /* $NetBSD: psym_do_stmt.c,v 1.4 2022/04/24 10:36:37 rillig Exp $ */
2 
3 /*
4  * Tests for the parser symbol psym_do_stmt, which represents the state after
5  * reading the keyword 'do' and the loop body, now waiting for the keyword
6  * 'while' and the controlling expression.
7  */
8 
9 //indent input
10 void function(void) {
11 	do stmt(); while (0);
12 	do { stmt(); } while (0);
13 	do /* comment */ stmt(); while (0);
14 }
15 //indent end
16 
17 //indent run
18 void
19 function(void)
20 {
21 	do
22 		stmt();
23 	while (0);
24 	do {
25 		stmt();
26 	} while (0);
27 	do			/* comment */
28 		stmt();
29 	while (0);
30 }
31 //indent end
32