xref: /netbsd-src/tests/usr.bin/indent/opt_bap_sob.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /* $NetBSD: opt_bap_sob.c,v 1.4 2022/04/24 09:04:12 rillig Exp $ */
2 
3 /*
4  * As of 2021-03-08, the combination of -bap and -sob, which occurs in the
5  * example indent.pro from NetBSD, removes the empty line above the
6  * separator.  Seen in games/cgram/cgram.c.
7  */
8 
9 //indent input
10 void
11 function1(void)
12 {
13 }
14 
15 ///// C99 separator /////
16 
17 void
18 function2(void)
19 {
20 }
21 
22 /* C block separator */
23 
24 void
25 function3(void)
26 {
27 }
28 //indent end
29 
30 //indent run -bap -sob
31 void
32 function1(void)
33 {
34 }
35 /* $ FIXME: Keep the empty line between the '}' and the '//'. */
36 ///// C99 separator /////
37 
38 void
39 function2(void)
40 {
41 }
42 /* $ FIXME: Keep the empty line. */
43 /* C block separator */
44 
45 void
46 function3(void)
47 {
48 }
49 //indent end
50 
51 /*
52  * XXX: Strangely, the option '-nbap' keeps the empty lines after the
53  * function bodies.  That's exactly the opposite of the behavior that's
54  * described in the manual.
55  */
56 //indent run-equals-input -nbap -sob
57 
58 /*
59  * Without '-sob', the option '-bap' works as intended.
60  */
61 //indent run-equals-input -bap
62