xref: /netbsd/tests/usr.bin/indent/fmt_init.c (revision 492a5052)
1 /* $NetBSD: fmt_init.c,v 1.1 2022/04/24 10:36:37 rillig Exp $ */
2 
3 /*
4  * Tests for variable initializations.
5  */
6 
7 //indent input
8 int global = { initializer };
9 int global = {
10 	initializer
11 };
12 
13 void
example(void)14 example(void)
15 {
16 	int local = { initializer };
17 	int local = {
18 		initializer
19 	};
20 }
21 //indent end
22 
23 //indent run -di0
24 // $ XXX: The spaces around the initializer are gone.
25 int global = {initializer};
26 int global = {
27 	initializer
28 };
29 
30 void
example(void)31 example(void)
32 {
33 	// $ XXX: The spaces around the initializer are gone.
34 	int local = {initializer};
35 	int local = {
36 		initializer
37 	};
38 }
39 //indent end
40