xref: /freebsd/usr.bin/indent/tests/elsecomment.0 (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1/* $FreeBSD$ */
2/* See r303484 and r309342 */
3void t(void) {
4	/* The two if statements below excercise two different code paths. */
5
6	if (1) /* a */ int a; else /* b */ int b;
7
8	if (1) /* a */
9		int a;
10	else /* b */
11		int b;
12
13	if (1) {
14
15	}
16
17
18
19	/* Old indent would remove the 3 blank lines above, awaiting "else". */
20
21	if (1) {
22		int a;
23	}
24
25
26	else if (0) {
27		int b;
28	}
29	/* test */
30	else
31		;
32
33	if (1)
34		;
35	else /* Old indent would get very confused here */
36	/* We also mustn't assume that there's only one comment */
37	/* before the left brace. */
38	{
39
40
41	}
42}
43