xref: /netbsd-src/tests/usr.bin/indent/psym_for_exprs.c (revision ccd9df534e375a4366c5b55f23782053c7a98d82)
1 /* $NetBSD: psym_for_exprs.c,v 1.6 2023/05/15 08:56:39 rillig Exp $ */
2 
3 /*
4  * Tests for the parser state psym_for_exprs, which represents the state after
5  * reading the keyword 'for' and the 3 expressions, now waiting for the body
6  * of the loop.
7  */
8 
9 //indent input
10 void
11 for_loops(void)
12 {
13 	int i;
14 
15 	for (i = 0; i < 10; i++)
16 		printf("%d * %d = %d\n", i, 7, i * 7);
17 	for (i = 0; i < 10; i++) {
18 		printf("%d * %d = %d\n", i, 7, i * 7);
19 	}
20 
21 	for (int j = 0; j < 10; j++)
22 		printf("%d * %d = %d\n", j, 7, j * 7);
23 	for (int j = 0; j < 10; j++) {
24 		printf("%d * %d = %d\n", j, 7, j * 7);
25 	}
26 }
27 //indent end
28 
29 //indent run-equals-input -ldi0
30