summaryrefslogtreecommitdiff
path: root/tests/usr.bin/indent/opt_ip.c
blob: 799d1a2e9418eb512fbaf335f84ce7766b2df2d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* $NetBSD: opt_ip.c,v 1.7 2022/04/24 09:04:12 rillig Exp $ */

/*
 * Tests for the options '-ip' and '-nip'.
 *
 * The option '-ip' indents parameter declarations from the left margin, for
 * traditional function definitions.
 *
 * The option '-nip' places the parameter declarations in column 1.
 */

//indent input
double
plus3(a, b, c)
	double a, b, c;
{
	return a + b + c;
}
//indent end

//indent run -ip
double
plus3(a, b, c)
	double		a, b, c;
{
	return a + b + c;
}
//indent end

//indent run -nip
double
plus3(a, b, c)
double		a, b, c;
{
	return a + b + c;
}
//indent end


//indent input
int
first_parameter_in_same_line(int a,
int b,
const char *cp);

int
parameters_in_separate_lines(
int a,
int b,
const char *cp);

int
multiple_parameters_per_line(
int a1, int a2,
int b1, int b2,
const char *cp);
//indent end

//indent run -ip
int
first_parameter_in_same_line(int a,
			     int b,
			     const char *cp);

int
parameters_in_separate_lines(
			     int a,
			     int b,
			     const char *cp);

int
multiple_parameters_per_line(
			     int a1, int a2,
			     int b1, int b2,
			     const char *cp);
//indent end

//indent run-equals-prev-output -nip