xref: /netbsd-src/tests/usr.bin/indent/opt_bc.c (revision aef5eb5f59cdfe8314f1b5f78ac04eb144e44010)
1 /* $NetBSD: opt_bc.c,v 1.6 2022/04/24 09:04:12 rillig Exp $ */
2 
3 /*
4  * Tests for the options '-bc' and '-nbc'.
5  *
6  * The option '-bc' forces a newline after each comma in a declaration.
7  *
8  * The option '-nbc' removes line breaks between declarators.  In most other
9  * places, indent preserves line breaks.
10  */
11 
12 //indent input
13 int a,b,c;
14 void function_declaration(int a,int b,int c);
15 int m1,
16 m2,
17 m3;
18 char plain, *pointer;
19 //indent end
20 
21 //indent run -bc
22 int		a,
23 		b,
24 		c;
25 void		function_declaration(int a, int b, int c);
26 int		m1,
27 		m2,
28 		m3;
29 char		plain,
30 	       *pointer;
31 //indent end
32 
33 //indent run -nbc
34 int		a, b, c;
35 void		function_declaration(int a, int b, int c);
36 int		m1, m2, m3;
37 char		plain, *pointer;
38 //indent end
39 
40 
41 //indent input
42 old_style_definition(a, b, c)
43 double a,b,c;
44 {
45     return a+b+c;
46 }
47 //indent end
48 
49 //indent run -bc
50 old_style_definition(a, b, c)
51 double		a,
52 		b,
53 		c;
54 {
55 	return a + b + c;
56 }
57 //indent end
58 
59 //indent run -nbc
60 old_style_definition(a, b, c)
61 double		a, b, c;
62 {
63 	return a + b + c;
64 }
65 //indent end
66