1 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -verify %s -Wabsolute-value -Wno-int-conversion
2 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only %s -Wabsolute-value -Wno-int-conversion -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
5 long int labs(long int);
6 long long int llabs(long long int);
10 long double fabsl(long double);
12 float cabsf(float _Complex
);
13 double cabs(double _Complex
);
14 long double cabsl(long double _Complex
);
16 void test_int(int x
) {
22 // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of integer type}}
23 // expected-note@-2 {{use function 'abs' instead}}
24 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
26 // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of integer type}}
27 // expected-note@-2 {{use function 'abs' instead}}
28 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"abs"
30 // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of integer type}}
31 // expected-note@-2 {{use function 'abs' instead}}
32 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
35 // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of integer type}}
36 // expected-note@-2 {{use function 'abs' instead}}
37 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
39 // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of integer type}}
40 // expected-note@-2 {{use function 'abs' instead}}
41 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"abs"
43 // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of integer type}}
44 // expected-note@-2 {{use function 'abs' instead}}
45 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
47 (void)__builtin_abs(x
);
48 (void)__builtin_labs(x
);
49 (void)__builtin_llabs(x
);
51 (void)__builtin_fabsf(x
);
52 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of integer type}}
53 // expected-note@-2 {{use function '__builtin_abs' instead}}
54 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
55 (void)__builtin_fabs(x
);
56 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of integer type}}
57 // expected-note@-2 {{use function '__builtin_abs' instead}}
58 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_abs"
59 (void)__builtin_fabsl(x
);
60 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of integer type}}
61 // expected-note@-2 {{use function '__builtin_abs' instead}}
62 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
64 (void)__builtin_cabsf(x
);
65 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of integer type}}
66 // expected-note@-2 {{use function '__builtin_abs' instead}}
67 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
68 (void)__builtin_cabs(x
);
69 // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of integer type}}
70 // expected-note@-2 {{use function '__builtin_abs' instead}}
71 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_abs"
72 (void)__builtin_cabsl(x
);
73 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of integer type}}
74 // expected-note@-2 {{use function '__builtin_abs' instead}}
75 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
78 void test_long(long x
) {
79 (void)abs(x
); // no warning - int and long are same length for this target
84 // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of integer type}}
85 // expected-note@-2 {{use function 'labs' instead}}
86 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
88 // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of integer type}}
89 // expected-note@-2 {{use function 'labs' instead}}
90 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"labs"
92 // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of integer type}}
93 // expected-note@-2 {{use function 'labs' instead}}
94 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
97 // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of integer type}}
98 // expected-note@-2 {{use function 'labs' instead}}
99 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
101 // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of integer type}}
102 // expected-note@-2 {{use function 'labs' instead}}
103 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"labs"
105 // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of integer type}}
106 // expected-note@-2 {{use function 'labs' instead}}
107 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
109 (void)__builtin_abs(x
); // no warning - int and long are same length for
111 (void)__builtin_labs(x
);
112 (void)__builtin_llabs(x
);
114 (void)__builtin_fabsf(x
);
115 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of integer type}}
116 // expected-note@-2 {{use function '__builtin_labs' instead}}
117 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
118 (void)__builtin_fabs(x
);
119 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of integer type}}
120 // expected-note@-2 {{use function '__builtin_labs' instead}}
121 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_labs"
122 (void)__builtin_fabsl(x
);
123 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of integer type}}
124 // expected-note@-2 {{use function '__builtin_labs' instead}}
125 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
127 (void)__builtin_cabsf(x
);
128 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of integer type}}
129 // expected-note@-2 {{use function '__builtin_labs' instead}}
130 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
131 (void)__builtin_cabs(x
);
132 // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of integer type}}
133 // expected-note@-2 {{use function '__builtin_labs' instead}}
134 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_labs"
135 (void)__builtin_cabsl(x
);
136 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of integer type}}
137 // expected-note@-2 {{use function '__builtin_labs' instead}}
138 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
141 void test_long_long(long long x
) {
143 // expected-warning@-1{{absolute value function 'abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value}}
144 // expected-note@-2{{use function 'llabs' instead}}
145 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"llabs"
147 // expected-warning@-1{{absolute value function 'labs' given an argument of type 'long long' but has parameter of type 'long' which may cause truncation of value}}
148 // expected-note@-2{{use function 'llabs' instead}}
149 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"llabs"
153 // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of integer type}}
154 // expected-note@-2 {{use function 'llabs' instead}}
155 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
157 // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of integer type}}
158 // expected-note@-2 {{use function 'llabs' instead}}
159 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"llabs"
161 // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of integer type}}
162 // expected-note@-2 {{use function 'llabs' instead}}
163 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
166 // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of integer type}}
167 // expected-note@-2 {{use function 'llabs' instead}}
168 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
170 // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of integer type}}
171 // expected-note@-2 {{use function 'llabs' instead}}
172 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"llabs"
174 // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of integer type}}
175 // expected-note@-2 {{use function 'llabs' instead}}
176 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
178 (void)__builtin_abs(x
);
179 // expected-warning@-1{{absolute value function '__builtin_abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value}}
180 // expected-note@-2{{use function '__builtin_llabs' instead}}
181 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_llabs"
182 (void)__builtin_labs(x
);
183 // expected-warning@-1{{absolute value function '__builtin_labs' given an argument of type 'long long' but has parameter of type 'long' which may cause truncation of value}}
184 // expected-note@-2{{use function '__builtin_llabs' instead}}
185 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_llabs"
186 (void)__builtin_llabs(x
);
188 (void)__builtin_fabsf(x
);
189 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of integer type}}
190 // expected-note@-2 {{use function '__builtin_llabs' instead}}
191 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
192 (void)__builtin_fabs(x
);
193 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of integer type}}
194 // expected-note@-2 {{use function '__builtin_llabs' instead}}
195 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_llabs"
196 (void)__builtin_fabsl(x
);
197 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of integer type}}
198 // expected-note@-2 {{use function '__builtin_llabs' instead}}
199 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
201 (void)__builtin_cabsf(x
);
202 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of integer type}}
203 // expected-note@-2 {{use function '__builtin_llabs' instead}}
204 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
205 (void)__builtin_cabs(x
);
206 // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of integer type}}
207 // expected-note@-2 {{use function '__builtin_llabs' instead}}
208 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_llabs"
209 (void)__builtin_cabsl(x
);
210 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of integer type}}
211 // expected-note@-2 {{use function '__builtin_llabs' instead}}
212 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
215 void test_float(float x
) {
217 // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of floating point type}}
218 // expected-note@-2 {{use function 'fabsf' instead}}
219 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"fabsf"
221 // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of floating point type}}
222 // expected-note@-2 {{use function 'fabsf' instead}}
223 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsf"
225 // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of floating point type}}
226 // expected-note@-2 {{use function 'fabsf' instead}}
227 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsf"
234 // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of floating point type}}
235 // expected-note@-2 {{use function 'fabsf' instead}}
236 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsf"
238 // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of floating point type}}
239 // expected-note@-2 {{use function 'fabsf' instead}}
240 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsf"
242 // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of floating point type}}
243 // expected-note@-2 {{use function 'fabsf' instead}}
244 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsf"
246 (void)__builtin_abs(x
);
247 // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of floating point type}}
248 // expected-note@-2 {{use function '__builtin_fabsf' instead}}
249 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_fabsf"
250 (void)__builtin_labs(x
);
251 // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of floating point type}}
252 // expected-note@-2 {{use function '__builtin_fabsf' instead}}
253 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsf"
254 (void)__builtin_llabs(x
);
255 // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of floating point type}}
256 // expected-note@-2 {{use function '__builtin_fabsf' instead}}
257 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsf"
259 (void)__builtin_fabsf(x
);
260 (void)__builtin_fabs(x
);
261 (void)__builtin_fabsl(x
);
263 (void)__builtin_cabsf(x
);
264 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of floating point type}}
265 // expected-note@-2 {{use function '__builtin_fabsf' instead}}
266 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsf"
267 (void)__builtin_cabs(x
);
268 // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of floating point type}}
269 // expected-note@-2 {{use function '__builtin_fabsf' instead}}
270 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsf"
271 (void)__builtin_cabsl(x
);
272 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of floating point type}}
273 // expected-note@-2 {{use function '__builtin_fabsf' instead}}
274 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsf"
277 void test_double(double x
) {
279 // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of floating point type}}
280 // expected-note@-2 {{use function 'fabs' instead}}
281 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"fabs"
283 // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of floating point type}}
284 // expected-note@-2 {{use function 'fabs' instead}}
285 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabs"
287 // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of floating point type}}
288 // expected-note@-2 {{use function 'fabs' instead}}
289 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
292 // expected-warning@-1{{absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value}}
293 // expected-note@-2{{use function 'fabs' instead}}
294 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
299 // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of floating point type}}
300 // expected-note@-2 {{use function 'fabs' instead}}
301 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
303 // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of floating point type}}
304 // expected-note@-2 {{use function 'fabs' instead}}
305 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabs"
307 // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of floating point type}}
308 // expected-note@-2 {{use function 'fabs' instead}}
309 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
311 (void)__builtin_abs(x
);
312 // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of floating point type}}
313 // expected-note@-2 {{use function '__builtin_fabs' instead}}
314 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_fabs"
315 (void)__builtin_labs(x
);
316 // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of floating point type}}
317 // expected-note@-2 {{use function '__builtin_fabs' instead}}
318 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabs"
319 (void)__builtin_llabs(x
);
320 // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of floating point type}}
321 // expected-note@-2 {{use function '__builtin_fabs' instead}}
322 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
324 (void)__builtin_fabsf(x
);
325 // expected-warning@-1{{absolute value function '__builtin_fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value}}
326 // expected-note@-2{{use function '__builtin_fabs' instead}}
327 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
328 (void)__builtin_fabs(x
);
329 (void)__builtin_fabsl(x
);
331 (void)__builtin_cabsf(x
);
332 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of floating point type}}
333 // expected-note@-2 {{use function '__builtin_fabs' instead}}
334 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
335 (void)__builtin_cabs(x
);
336 // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of floating point type}}
337 // expected-note@-2 {{use function '__builtin_fabs' instead}}
338 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabs"
339 (void)__builtin_cabsl(x
);
340 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of floating point type}}
341 // expected-note@-2 {{use function '__builtin_fabs' instead}}
342 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
345 void test_long_double(long double x
) {
347 // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of floating point type}}
348 // expected-note@-2 {{use function 'fabsl' instead}}
349 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"fabsl"
351 // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of floating point type}}
352 // expected-note@-2 {{use function 'fabsl' instead}}
353 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsl"
355 // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of floating point type}}
356 // expected-note@-2 {{use function 'fabsl' instead}}
357 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
360 // expected-warning@-1{{absolute value function 'fabsf' given an argument of type 'long double' but has parameter of type 'float' which may cause truncation of value}}
361 // expected-note@-2{{use function 'fabsl' instead}}
362 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
364 // expected-warning@-1{{absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value}}
365 // expected-note@-2{{use function 'fabsl' instead}}
366 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsl"
370 // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of floating point type}}
371 // expected-note@-2 {{use function 'fabsl' instead}}
372 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
374 // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of floating point type}}
375 // expected-note@-2 {{use function 'fabsl' instead}}
376 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsl"
378 // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of floating point type}}
379 // expected-note@-2 {{use function 'fabsl' instead}}
380 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
382 (void)__builtin_abs(x
);
383 // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of floating point type}}
384 // expected-note@-2 {{use function '__builtin_fabsl' instead}}
385 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_fabsl"
386 (void)__builtin_labs(x
);
387 // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of floating point type}}
388 // expected-note@-2 {{use function '__builtin_fabsl' instead}}
389 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsl"
390 (void)__builtin_llabs(x
);
391 // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of floating point type}}
392 // expected-note@-2 {{use function '__builtin_fabsl' instead}}
393 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
395 (void)__builtin_fabsf(x
);
396 // expected-warning@-1{{absolute value function '__builtin_fabsf' given an argument of type 'long double' but has parameter of type 'float' which may cause truncation of value}}
397 // expected-note@-2{{use function '__builtin_fabsl' instead}}
398 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
399 (void)__builtin_fabs(x
);
400 // expected-warning@-1{{absolute value function '__builtin_fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value}}
401 // expected-note@-2{{use function '__builtin_fabsl' instead}}
402 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsl"
403 (void)__builtin_fabsl(x
);
405 (void)__builtin_cabsf(x
);
406 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of floating point type}}
407 // expected-note@-2 {{use function '__builtin_fabsl' instead}}
408 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
409 (void)__builtin_cabs(x
);
410 // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of floating point type}}
411 // expected-note@-2 {{use function '__builtin_fabsl' instead}}
412 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsl"
413 (void)__builtin_cabsl(x
);
414 // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of floating point type}}
415 // expected-note@-2 {{use function '__builtin_fabsl' instead}}
416 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
419 void test_complex_float(_Complex
float x
) {
421 // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of complex type}}
422 // expected-note@-2 {{use function 'cabsf' instead}}
423 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"cabsf"
425 // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of complex type}}
426 // expected-note@-2 {{use function 'cabsf' instead}}
427 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsf"
429 // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of complex type}}
430 // expected-note@-2 {{use function 'cabsf' instead}}
431 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsf"
434 // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of complex type}}
435 // expected-note@-2 {{use function 'cabsf' instead}}
436 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsf"
438 // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of complex type}}
439 // expected-note@-2 {{use function 'cabsf' instead}}
440 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsf"
442 // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of complex type}}
443 // expected-note@-2 {{use function 'cabsf' instead}}
444 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsf"
450 (void)__builtin_abs(x
);
451 // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of complex type}}
452 // expected-note@-2 {{use function '__builtin_cabsf' instead}}
453 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_cabsf"
454 (void)__builtin_labs(x
);
455 // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of complex type}}
456 // expected-note@-2 {{use function '__builtin_cabsf' instead}}
457 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsf"
458 (void)__builtin_llabs(x
);
459 // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of complex type}}
460 // expected-note@-2 {{use function '__builtin_cabsf' instead}}
461 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsf"
463 (void)__builtin_fabsf(x
);
464 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of complex type}}
465 // expected-note@-2 {{use function '__builtin_cabsf' instead}}
466 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsf"
467 (void)__builtin_fabs(x
);
468 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of complex type}}
469 // expected-note@-2 {{use function '__builtin_cabsf' instead}}
470 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsf"
471 (void)__builtin_fabsl(x
);
472 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of complex type}}
473 // expected-note@-2 {{use function '__builtin_cabsf' instead}}
474 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsf"
476 (void)__builtin_cabsf(x
);
477 (void)__builtin_cabs(x
);
478 (void)__builtin_cabsl(x
);
481 void test_complex_double(_Complex
double x
) {
483 // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of complex type}}
484 // expected-note@-2 {{use function 'cabs' instead}}
485 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"cabs"
487 // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of complex type}}
488 // expected-note@-2 {{use function 'cabs' instead}}
489 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabs"
491 // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of complex type}}
492 // expected-note@-2 {{use function 'cabs' instead}}
493 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
496 // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of complex type}}
497 // expected-note@-2 {{use function 'cabs' instead}}
498 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
500 // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of complex type}}
501 // expected-note@-2 {{use function 'cabs' instead}}
502 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabs"
504 // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of complex type}}
505 // expected-note@-2 {{use function 'cabs' instead}}
506 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
509 // expected-warning@-1 {{absolute value function 'cabsf' given an argument of type '_Complex double' but has parameter of type '_Complex float' which may cause truncation of value}}
510 // expected-note@-2 {{use function 'cabs' instead}}
511 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
515 (void)__builtin_abs(x
);
516 // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of complex type}}
517 // expected-note@-2 {{use function '__builtin_cabs' instead}}
518 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_cabs"
519 (void)__builtin_labs(x
);
520 // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of complex type}}
521 // expected-note@-2 {{use function '__builtin_cabs' instead}}
522 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabs"
523 (void)__builtin_llabs(x
);
524 // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of complex type}}
525 // expected-note@-2 {{use function '__builtin_cabs' instead}}
526 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
528 (void)__builtin_fabsf(x
);
529 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of complex type}}
530 // expected-note@-2 {{use function '__builtin_cabs' instead}}
531 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
532 (void)__builtin_fabs(x
);
533 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of complex type}}
534 // expected-note@-2 {{use function '__builtin_cabs' instead}}
535 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabs"
536 (void)__builtin_fabsl(x
);
537 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of complex type}}
538 // expected-note@-2 {{use function '__builtin_cabs' instead}}
539 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
541 (void)__builtin_cabsf(x
);
542 // expected-warning@-1 {{absolute value function '__builtin_cabsf' given an argument of type '_Complex double' but has parameter of type '_Complex float' which may cause truncation of value}}
543 // expected-note@-2 {{use function '__builtin_cabs' instead}}
544 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
545 (void)__builtin_cabs(x
);
546 (void)__builtin_cabsl(x
);
549 void test_complex_long_double(_Complex
long double x
) {
551 // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of complex type}}
552 // expected-note@-2 {{use function 'cabsl' instead}}
553 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"cabsl"
555 // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of complex type}}
556 // expected-note@-2 {{use function 'cabsl' instead}}
557 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsl"
559 // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of complex type}}
560 // expected-note@-2 {{use function 'cabsl' instead}}
561 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
564 // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of complex type}}
565 // expected-note@-2 {{use function 'cabsl' instead}}
566 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
568 // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of complex type}}
569 // expected-note@-2 {{use function 'cabsl' instead}}
570 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsl"
572 // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of complex type}}
573 // expected-note@-2 {{use function 'cabsl' instead}}
574 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
577 // expected-warning@-1 {{absolute value function 'cabsf' given an argument of type '_Complex long double' but has parameter of type '_Complex float' which may cause truncation of value}}
578 // expected-note@-2 {{use function 'cabsl' instead}}
579 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
581 // expected-warning@-1 {{absolute value function 'cabs' given an argument of type '_Complex long double' but has parameter of type '_Complex double' which may cause truncation of value}}
582 // expected-note@-2 {{use function 'cabsl' instead}}
583 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsl"
586 (void)__builtin_abs(x
);
587 // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of complex type}}
588 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
589 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_cabsl"
590 (void)__builtin_labs(x
);
591 // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of complex type}}
592 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
593 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsl"
594 (void)__builtin_llabs(x
);
595 // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of complex type}}
596 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
597 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
599 (void)__builtin_fabsf(x
);
600 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of complex type}}
601 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
602 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
603 (void)__builtin_fabs(x
);
604 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of complex type}}
605 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
606 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsl"
607 (void)__builtin_fabsl(x
);
608 // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of complex type}}
609 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
610 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
612 (void)__builtin_cabsf(x
);
613 // expected-warning@-1 {{absolute value function '__builtin_cabsf' given an argument of type '_Complex long double' but has parameter of type '_Complex float' which may cause truncation of value}}
614 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
615 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
616 (void)__builtin_cabs(x
);
617 // expected-warning@-1 {{absolute value function '__builtin_cabs' given an argument of type '_Complex long double' but has parameter of type '_Complex double' which may cause truncation of value}}
618 // expected-note@-2 {{use function '__builtin_cabsl' instead}}
619 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsl"
620 (void)__builtin_cabsl(x
);
623 void test_unsigned_int(unsigned int x
) {
625 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
626 // expected-note@-2 {{remove the call to 'abs' since unsigned values cannot be negative}}
627 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:""
629 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
630 // expected-note@-2 {{remove the call to 'labs' since unsigned values cannot be negative}}
631 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
633 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
634 // expected-note@-2 {{remove the call to 'llabs' since unsigned values cannot be negative}}
635 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
638 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
639 // expected-note@-2 {{remove the call to 'fabsf' since unsigned values cannot be negative}}
640 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
642 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
643 // expected-note@-2 {{remove the call to 'fabs' since unsigned values cannot be negative}}
644 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
646 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
647 // expected-note@-2 {{remove the call to 'fabsl' since unsigned values cannot be negative}}
648 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
651 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
652 // expected-note@-2 {{remove the call to 'cabsf' since unsigned values cannot be negative}}
653 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
655 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
656 // expected-note@-2 {{remove the call to 'cabs' since unsigned values cannot be negative}}
657 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
659 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
660 // expected-note@-2 {{remove the call to 'cabsl' since unsigned values cannot be negative}}
661 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
663 (void)__builtin_abs(x
);
664 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
665 // expected-note@-2 {{remove the call to '__builtin_abs' since unsigned values cannot be negative}}
666 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:""
667 (void)__builtin_labs(x
);
668 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
669 // expected-note@-2 {{remove the call to '__builtin_labs' since unsigned values cannot be negative}}
670 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
671 (void)__builtin_llabs(x
);
672 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
673 // expected-note@-2 {{remove the call to '__builtin_llabs' since unsigned values cannot be negative}}
674 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
676 (void)__builtin_fabsf(x
);
677 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
678 // expected-note@-2 {{remove the call to '__builtin_fabsf' since unsigned values cannot be negative}}
679 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
680 (void)__builtin_fabs(x
);
681 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
682 // expected-note@-2 {{remove the call to '__builtin_fabs' since unsigned values cannot be negative}}
683 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
684 (void)__builtin_fabsl(x
);
685 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
686 // expected-note@-2 {{remove the call to '__builtin_fabsl' since unsigned values cannot be negative}}
687 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
689 (void)__builtin_cabsf(x
);
690 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
691 // expected-note@-2 {{remove the call to '__builtin_cabsf' since unsigned values cannot be negative}}
692 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
693 (void)__builtin_cabs(x
);
694 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
695 // expected-note@-2 {{remove the call to '__builtin_cabs' since unsigned values cannot be negative}}
696 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
697 (void)__builtin_cabsl(x
);
698 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
699 // expected-note@-2 {{remove the call to '__builtin_cabsl' since unsigned values cannot be negative}}
700 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
703 void test_unsigned_long(unsigned long x
) {
705 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
706 // expected-note@-2 {{remove the call to 'abs' since unsigned values cannot be negative}}
707 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:""
709 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
710 // expected-note@-2 {{remove the call to 'labs' since unsigned values cannot be negative}}
711 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
713 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
714 // expected-note@-2 {{remove the call to 'llabs' since unsigned values cannot be negative}}
715 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
718 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
719 // expected-note@-2 {{remove the call to 'fabsf' since unsigned values cannot be negative}}
720 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
722 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
723 // expected-note@-2 {{remove the call to 'fabs' since unsigned values cannot be negative}}
724 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
726 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
727 // expected-note@-2 {{remove the call to 'fabsl' since unsigned values cannot be negative}}
728 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
731 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
732 // expected-note@-2 {{remove the call to 'cabsf' since unsigned values cannot be negative}}
733 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
735 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
736 // expected-note@-2 {{remove the call to 'cabs' since unsigned values cannot be negative}}
737 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
739 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
740 // expected-note@-2 {{remove the call to 'cabsl' since unsigned values cannot be negative}}
741 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
743 (void)__builtin_abs(x
);
744 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
745 // expected-note@-2 {{remove the call to '__builtin_abs' since unsigned values cannot be negative}}
746 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:""
747 (void)__builtin_labs(x
);
748 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
749 // expected-note@-2 {{remove the call to '__builtin_labs' since unsigned values cannot be negative}}
750 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
751 (void)__builtin_llabs(x
);
752 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
753 // expected-note@-2 {{remove the call to '__builtin_llabs' since unsigned values cannot be negative}}
754 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
756 (void)__builtin_fabsf(x
);
757 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
758 // expected-note@-2 {{remove the call to '__builtin_fabsf' since unsigned values cannot be negative}}
759 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
760 (void)__builtin_fabs(x
);
761 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
762 // expected-note@-2 {{remove the call to '__builtin_fabs' since unsigned values cannot be negative}}
763 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
764 (void)__builtin_fabsl(x
);
765 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
766 // expected-note@-2 {{remove the call to '__builtin_fabsl' since unsigned values cannot be negative}}
767 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
769 (void)__builtin_cabsf(x
);
770 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
771 // expected-note@-2 {{remove the call to '__builtin_cabsf' since unsigned values cannot be negative}}
772 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
773 (void)__builtin_cabs(x
);
774 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
775 // expected-note@-2 {{remove the call to '__builtin_cabs' since unsigned values cannot be negative}}
776 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
777 (void)__builtin_cabsl(x
);
778 // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
779 // expected-note@-2 {{remove the call to '__builtin_cabsl' since unsigned values cannot be negative}}
780 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
783 long long test_array(void) {
784 return llabs((long long[]){1});
785 // expected-warning@-1 {{absolute value of array type}}
787 long long test_function_pointer(void) {
788 return llabs(&test_function_pointer
);
789 // expected-warning@-1 {{absolute value of pointer type}}
791 long long test_void_pointer(void *x
) {
793 // expected-warning@-1 {{absolute value of pointer type}}
795 long long test_function(void) {
796 return llabs(test_function
);
797 // expected-warning@-1 {{absolute value of function type}}