xref: /netbsd-src/tests/usr.bin/indent/lsym_form_feed.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /* $NetBSD: lsym_form_feed.c,v 1.4 2022/04/24 10:36:37 rillig Exp $ */
2 
3 /*
4  * Tests for the token lsym_form_feed, which represents a form feed, a special
5  * kind of whitespace that is seldom used.  If it is used, it usually appears
6  * on a line of its own, after an external-declaration, to force a page break
7  * when printing the source code on actual paper.
8  */
9 
10 //indent input
11 void function_1(void);
12 
13 void function_2(void);
14 //indent end
15 
16 //indent run -di0
17 void function_1(void);
18 
19 /* $ XXX: The form feed is not preserved. */
20 /* $ XXX: Why 2 empty lines? */
21 
22 void function_2(void);
23 //indent end
24 
25 
26 /*
27  * Test form feed after 'if (expr)', which is handled in search_stmt.
28  */
29 //indent input
30 void function(void)
31 {
32 	if (expr)
33 	 /* <-- form feed */
34 	{
35 	}
36 }
37 //indent end
38 
39 //indent run
40 void
41 function(void)
42 {
43 	if (expr) {
44 		/* $ XXX: The form feed has disappeared. */
45 		/* <-- form feed */
46 	}
47 }
48 //indent end
49