xref: /netbsd-src/tests/usr.bin/indent/lsym_while.c (revision 867d70fc718005c0918b8b8b2f9d7f2d52d0a0db)
1 /* $NetBSD: lsym_while.c,v 1.4 2022/04/24 10:36:37 rillig Exp $ */
2 
3 /*
4  * Tests for the token 'lsym_while', which represents the keyword 'while' that
5  * starts a 'while' loop or finishes a 'do-while' loop.
6  */
7 
8 //indent input
9 void
10 function(void)
11 {
12 	while(cond)stmt();
13 	do stmt();while(cond);
14 }
15 //indent end
16 
17 //indent run
18 void
19 function(void)
20 {
21 	while (cond)
22 		stmt();
23 	do
24 		stmt();
25 	while (cond);
26 }
27 //indent end
28