summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/expected/c/02457-nl_before_return.c
blob: a396202fa3536ed33562f35dcd99049ff0dc352c (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
int foo1(int arg)
{
	if (arg == 0) return 1;
	if (arg == 1) /* comment */ return 2;
	if (arg == 2)
		/* C-style comment */
		return 3;
	if (arg == 3) /* trailing comment */
		return 4;
	if (arg == 4) /* trailing comment */
		/* C-style comment */
		return 5;
	if (arg == 5)
		// C++-style comment
		return 6;
	if (arg == 6)
		// Multi-line
		// C++-style comment
		return 7;
	if (arg == 7) // trailing comment
		// Multi-line
		// C++-style comment
		return 8;
	if (arg == 8)
		/*
		 * Multi-line C-style comment
		 */
		return 9;
	if (arg == 9)
		/*--------------------*/
		/* Multi-part comment */
		/*--------------------*/
		return 10;
	if (arg == 10)
		//-----------------------
		/*
		 * Mixed-style comment
		 */
		//-----------------------
		return 11;
	if (arg == 11)
		/* comment */ return 12;
	if (arg == 12)

		// C++-style comment
		return 13;

	return arg + 1;
}

int foo2(int arg)
{
	if (arg == 0) { return 1; }
	if (arg == 1) { /* comment */ return 2; }
	if (arg == 2) {
		/* C-style comment */
		return 3;
	}
	if (arg == 3) { /* trailing comment */
		return 4;
	}
	if (arg == 4) { /* trailing comment */
		/* C-style comment */
		return 5;
	}
	if (arg == 5) {
		// C++-style comment
		return 6;
	}
	if (arg == 6) {
		// Multi-line
		// C++-style comment
		return 7;
	}
	if (arg == 7) { // trailing comment
		// Multi-line
		// C++-style comment
		return 8;
	}
	if (arg == 8) {
		/*
		 * Multi-line C-style comment
		 */
		return 9;
	}
	if (arg == 9)
	{
		/*--------------------*/
		/* Multi-part comment */
		/*--------------------*/
		return 10;
	}
	if (arg == 10)
	{
		//-----------------------
		/* Mixed-style comment */
		//-----------------------
		return 11;
	}
	if (arg == 11)
	{
		/* comment */ return 12;
	}
	if (arg == 12) {

		/* C-style comment */
		return 13;
	}

	return arg + 1;
}

int foo2(int arg)
{
	if (arg == 0) { int a = 1; return a; }
	if (arg == 1) { int a = 2; /* comment */ return a; }
	if (arg == 2) {
		int a = 3;

		/* C-style comment */
		return a;
	}
	if (arg == 3) {
		int a = 4; /* trailing comment */

		return a;
	}
	if (arg == 4) {
		int a = 5; /* trailing comment */

		/* C-style comment */
		return a;
	}
	if (arg == 5) {
		int a = 6;

		// C++-style comment
		return a;
	}
	if (arg == 6) {
		int a = 7;

		// Multi-line
		// C++-style comment
		return a;
	}
	if (arg == 7) {
		int a = 8; // trailing comment

		// Multi-line
		// C++-style comment
		return a;
	}
	if (arg == 8) {
		int a = 9;

		/*--------------------*/
		/* Multi-part comment */
		/*--------------------*/
		return a;
	}
	if (arg == 9) {
		int a = 10;

		/*---------------------*/
		// Mixed-style comment
		/*---------------------*/
		return a;
	}
	if (arg == 11)
	{
		int a = 12;

		/* comment */ return a;
	}
	if (arg == 12) {
		int a = 13;

		/*
		 * Multi-line C-style comment
		 */
		return a;
	}

	return arg + 1;
}