xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/warn-absolute-value.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -verify %s -Wabsolute-value
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only %s -Wabsolute-value -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc int abs(int);
5*0a6a1f1dSLionel Sambuc long int labs(long int);
6*0a6a1f1dSLionel Sambuc long long int llabs(long long int);
7*0a6a1f1dSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc float fabsf(float);
9*0a6a1f1dSLionel Sambuc double fabs(double);
10*0a6a1f1dSLionel Sambuc long double fabsl(long double);
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc float cabsf(float _Complex);
13*0a6a1f1dSLionel Sambuc double cabs(double _Complex);
14*0a6a1f1dSLionel Sambuc long double cabsl(long double _Complex);
15*0a6a1f1dSLionel Sambuc 
test_int(int x)16*0a6a1f1dSLionel Sambuc void test_int(int x) {
17*0a6a1f1dSLionel Sambuc   (void)abs(x);
18*0a6a1f1dSLionel Sambuc   (void)labs(x);
19*0a6a1f1dSLionel Sambuc   (void)llabs(x);
20*0a6a1f1dSLionel Sambuc 
21*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
22*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of integer type}}
23*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'abs' instead}}
24*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
25*0a6a1f1dSLionel Sambuc   (void)fabs(x);
26*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of integer type}}
27*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'abs' instead}}
28*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"abs"
29*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
30*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of integer type}}
31*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'abs' instead}}
32*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
33*0a6a1f1dSLionel Sambuc 
34*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
35*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of integer type}}
36*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'abs' instead}}
37*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
38*0a6a1f1dSLionel Sambuc   (void)cabs(x);
39*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of integer type}}
40*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'abs' instead}}
41*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"abs"
42*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
43*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of integer type}}
44*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'abs' instead}}
45*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"abs"
46*0a6a1f1dSLionel Sambuc 
47*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
48*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
49*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
50*0a6a1f1dSLionel Sambuc 
51*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
52*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of integer type}}
53*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_abs' instead}}
54*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
55*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
56*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of integer type}}
57*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_abs' instead}}
58*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_abs"
59*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
60*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of integer type}}
61*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_abs' instead}}
62*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
63*0a6a1f1dSLionel Sambuc 
64*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
65*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of integer type}}
66*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_abs' instead}}
67*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
68*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
69*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of integer type}}
70*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_abs' instead}}
71*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_abs"
72*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
73*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of integer type}}
74*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_abs' instead}}
75*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_abs"
76*0a6a1f1dSLionel Sambuc }
77*0a6a1f1dSLionel Sambuc 
test_long(long x)78*0a6a1f1dSLionel Sambuc void test_long(long x) {
79*0a6a1f1dSLionel Sambuc   (void)abs(x);  // no warning - int and long are same length for this target
80*0a6a1f1dSLionel Sambuc   (void)labs(x);
81*0a6a1f1dSLionel Sambuc   (void)llabs(x);
82*0a6a1f1dSLionel Sambuc 
83*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
84*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of integer type}}
85*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'labs' instead}}
86*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
87*0a6a1f1dSLionel Sambuc   (void)fabs(x);
88*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of integer type}}
89*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'labs' instead}}
90*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"labs"
91*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
92*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of integer type}}
93*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'labs' instead}}
94*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
95*0a6a1f1dSLionel Sambuc 
96*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
97*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of integer type}}
98*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'labs' instead}}
99*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
100*0a6a1f1dSLionel Sambuc   (void)cabs(x);
101*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of integer type}}
102*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'labs' instead}}
103*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"labs"
104*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
105*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of integer type}}
106*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'labs' instead}}
107*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"labs"
108*0a6a1f1dSLionel Sambuc 
109*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);  // no warning - int and long are same length for
110*0a6a1f1dSLionel Sambuc                            // this target
111*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
112*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
113*0a6a1f1dSLionel Sambuc 
114*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
115*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of integer type}}
116*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_labs' instead}}
117*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
118*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
119*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of integer type}}
120*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_labs' instead}}
121*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_labs"
122*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
123*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of integer type}}
124*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_labs' instead}}
125*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
126*0a6a1f1dSLionel Sambuc 
127*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
128*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of integer type}}
129*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_labs' instead}}
130*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
131*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
132*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of integer type}}
133*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_labs' instead}}
134*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_labs"
135*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
136*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of integer type}}
137*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_labs' instead}}
138*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_labs"
139*0a6a1f1dSLionel Sambuc }
140*0a6a1f1dSLionel Sambuc 
test_long_long(long long x)141*0a6a1f1dSLionel Sambuc void test_long_long(long long x) {
142*0a6a1f1dSLionel Sambuc   (void)abs(x);
143*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function 'llabs' instead}}
145*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"llabs"
146*0a6a1f1dSLionel Sambuc   (void)labs(x);
147*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function 'llabs' instead}}
149*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"llabs"
150*0a6a1f1dSLionel Sambuc   (void)llabs(x);
151*0a6a1f1dSLionel Sambuc 
152*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
153*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of integer type}}
154*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'llabs' instead}}
155*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
156*0a6a1f1dSLionel Sambuc   (void)fabs(x);
157*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of integer type}}
158*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'llabs' instead}}
159*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"llabs"
160*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
161*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of integer type}}
162*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'llabs' instead}}
163*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
164*0a6a1f1dSLionel Sambuc 
165*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
166*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of integer type}}
167*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'llabs' instead}}
168*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
169*0a6a1f1dSLionel Sambuc   (void)cabs(x);
170*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of integer type}}
171*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'llabs' instead}}
172*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"llabs"
173*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
174*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of integer type}}
175*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'llabs' instead}}
176*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"llabs"
177*0a6a1f1dSLionel Sambuc 
178*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
179*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function '__builtin_llabs' instead}}
181*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_llabs"
182*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
183*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function '__builtin_llabs' instead}}
185*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_llabs"
186*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
187*0a6a1f1dSLionel Sambuc 
188*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
189*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of integer type}}
190*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_llabs' instead}}
191*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
192*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
193*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of integer type}}
194*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_llabs' instead}}
195*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_llabs"
196*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
197*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of integer type}}
198*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_llabs' instead}}
199*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
200*0a6a1f1dSLionel Sambuc 
201*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
202*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of integer type}}
203*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_llabs' instead}}
204*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
205*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
206*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of integer type}}
207*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_llabs' instead}}
208*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_llabs"
209*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
210*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of integer type}}
211*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_llabs' instead}}
212*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_llabs"
213*0a6a1f1dSLionel Sambuc }
214*0a6a1f1dSLionel Sambuc 
test_float(float x)215*0a6a1f1dSLionel Sambuc void test_float(float x) {
216*0a6a1f1dSLionel Sambuc   (void)abs(x);
217*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of floating point type}}
218*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsf' instead}}
219*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"fabsf"
220*0a6a1f1dSLionel Sambuc   (void)labs(x);
221*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of floating point type}}
222*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsf' instead}}
223*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsf"
224*0a6a1f1dSLionel Sambuc   (void)llabs(x);
225*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of floating point type}}
226*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsf' instead}}
227*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsf"
228*0a6a1f1dSLionel Sambuc 
229*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
230*0a6a1f1dSLionel Sambuc   (void)fabs(x);
231*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
232*0a6a1f1dSLionel Sambuc 
233*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
234*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of floating point type}}
235*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsf' instead}}
236*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsf"
237*0a6a1f1dSLionel Sambuc   (void)cabs(x);
238*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of floating point type}}
239*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsf' instead}}
240*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsf"
241*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
242*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of floating point type}}
243*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsf' instead}}
244*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsf"
245*0a6a1f1dSLionel Sambuc 
246*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
247*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of floating point type}}
248*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsf' instead}}
249*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_fabsf"
250*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
251*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of floating point type}}
252*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsf' instead}}
253*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsf"
254*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
255*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of floating point type}}
256*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsf' instead}}
257*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsf"
258*0a6a1f1dSLionel Sambuc 
259*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
260*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
261*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
262*0a6a1f1dSLionel Sambuc 
263*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
264*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of floating point type}}
265*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsf' instead}}
266*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsf"
267*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
268*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of floating point type}}
269*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsf' instead}}
270*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsf"
271*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
272*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of floating point type}}
273*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsf' instead}}
274*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsf"
275*0a6a1f1dSLionel Sambuc }
276*0a6a1f1dSLionel Sambuc 
test_double(double x)277*0a6a1f1dSLionel Sambuc void test_double(double x) {
278*0a6a1f1dSLionel Sambuc   (void)abs(x);
279*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of floating point type}}
280*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabs' instead}}
281*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"fabs"
282*0a6a1f1dSLionel Sambuc   (void)labs(x);
283*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of floating point type}}
284*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabs' instead}}
285*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabs"
286*0a6a1f1dSLionel Sambuc   (void)llabs(x);
287*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of floating point type}}
288*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabs' instead}}
289*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
290*0a6a1f1dSLionel Sambuc 
291*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
292*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function 'fabs' instead}}
294*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
295*0a6a1f1dSLionel Sambuc   (void)fabs(x);
296*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
297*0a6a1f1dSLionel Sambuc 
298*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
299*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of floating point type}}
300*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabs' instead}}
301*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
302*0a6a1f1dSLionel Sambuc   (void)cabs(x);
303*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of floating point type}}
304*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabs' instead}}
305*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabs"
306*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
307*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of floating point type}}
308*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabs' instead}}
309*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabs"
310*0a6a1f1dSLionel Sambuc 
311*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
312*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of floating point type}}
313*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabs' instead}}
314*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_fabs"
315*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
316*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of floating point type}}
317*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabs' instead}}
318*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabs"
319*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
320*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of floating point type}}
321*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabs' instead}}
322*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
323*0a6a1f1dSLionel Sambuc 
324*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
325*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function '__builtin_fabs' instead}}
327*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
328*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
329*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
330*0a6a1f1dSLionel Sambuc 
331*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
332*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of floating point type}}
333*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabs' instead}}
334*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
335*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
336*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of floating point type}}
337*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabs' instead}}
338*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabs"
339*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
340*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of floating point type}}
341*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabs' instead}}
342*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabs"
343*0a6a1f1dSLionel Sambuc }
344*0a6a1f1dSLionel Sambuc 
test_long_double(long double x)345*0a6a1f1dSLionel Sambuc void test_long_double(long double x) {
346*0a6a1f1dSLionel Sambuc   (void)abs(x);
347*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of floating point type}}
348*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsl' instead}}
349*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"fabsl"
350*0a6a1f1dSLionel Sambuc   (void)labs(x);
351*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of floating point type}}
352*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsl' instead}}
353*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsl"
354*0a6a1f1dSLionel Sambuc   (void)llabs(x);
355*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of floating point type}}
356*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsl' instead}}
357*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
358*0a6a1f1dSLionel Sambuc 
359*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
360*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function 'fabsl' instead}}
362*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
363*0a6a1f1dSLionel Sambuc   (void)fabs(x);
364*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function 'fabsl' instead}}
366*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsl"
367*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
368*0a6a1f1dSLionel Sambuc 
369*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
370*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsf' when argument is of floating point type}}
371*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsl' instead}}
372*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
373*0a6a1f1dSLionel Sambuc   (void)cabs(x);
374*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabs' when argument is of floating point type}}
375*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsl' instead}}
376*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"fabsl"
377*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
378*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function 'cabsl' when argument is of floating point type}}
379*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'fabsl' instead}}
380*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"fabsl"
381*0a6a1f1dSLionel Sambuc 
382*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
383*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of floating point type}}
384*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsl' instead}}
385*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_fabsl"
386*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
387*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of floating point type}}
388*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsl' instead}}
389*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsl"
390*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
391*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of floating point type}}
392*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsl' instead}}
393*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
394*0a6a1f1dSLionel Sambuc 
395*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
396*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function '__builtin_fabsl' instead}}
398*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
399*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
400*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2{{use function '__builtin_fabsl' instead}}
402*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsl"
403*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
404*0a6a1f1dSLionel Sambuc 
405*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
406*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsf' when argument is of floating point type}}
407*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsl' instead}}
408*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
409*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
410*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabs' when argument is of floating point type}}
411*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsl' instead}}
412*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_fabsl"
413*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
414*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using complex absolute value function '__builtin_cabsl' when argument is of floating point type}}
415*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_fabsl' instead}}
416*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_fabsl"
417*0a6a1f1dSLionel Sambuc }
418*0a6a1f1dSLionel Sambuc 
test_complex_float(_Complex float x)419*0a6a1f1dSLionel Sambuc void test_complex_float(_Complex float x) {
420*0a6a1f1dSLionel Sambuc   (void)abs(x);
421*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of complex type}}
422*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsf' instead}}
423*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"cabsf"
424*0a6a1f1dSLionel Sambuc   (void)labs(x);
425*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of complex type}}
426*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsf' instead}}
427*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsf"
428*0a6a1f1dSLionel Sambuc   (void)llabs(x);
429*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of complex type}}
430*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsf' instead}}
431*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsf"
432*0a6a1f1dSLionel Sambuc 
433*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
434*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of complex type}}
435*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsf' instead}}
436*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsf"
437*0a6a1f1dSLionel Sambuc   (void)fabs(x);
438*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of complex type}}
439*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsf' instead}}
440*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsf"
441*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
442*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of complex type}}
443*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsf' instead}}
444*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsf"
445*0a6a1f1dSLionel Sambuc 
446*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
447*0a6a1f1dSLionel Sambuc   (void)cabs(x);
448*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
449*0a6a1f1dSLionel Sambuc 
450*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
451*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of complex type}}
452*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsf' instead}}
453*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_cabsf"
454*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
455*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of complex type}}
456*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsf' instead}}
457*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsf"
458*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
459*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of complex type}}
460*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsf' instead}}
461*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsf"
462*0a6a1f1dSLionel Sambuc 
463*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
464*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of complex type}}
465*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsf' instead}}
466*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsf"
467*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
468*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of complex type}}
469*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsf' instead}}
470*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsf"
471*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
472*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of complex type}}
473*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsf' instead}}
474*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsf"
475*0a6a1f1dSLionel Sambuc 
476*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
477*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
478*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
479*0a6a1f1dSLionel Sambuc }
480*0a6a1f1dSLionel Sambuc 
test_complex_double(_Complex double x)481*0a6a1f1dSLionel Sambuc void test_complex_double(_Complex double x) {
482*0a6a1f1dSLionel Sambuc   (void)abs(x);
483*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of complex type}}
484*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
485*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"cabs"
486*0a6a1f1dSLionel Sambuc   (void)labs(x);
487*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of complex type}}
488*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
489*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabs"
490*0a6a1f1dSLionel Sambuc   (void)llabs(x);
491*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of complex type}}
492*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
493*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
494*0a6a1f1dSLionel Sambuc 
495*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
496*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of complex type}}
497*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
498*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
499*0a6a1f1dSLionel Sambuc   (void)fabs(x);
500*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of complex type}}
501*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
502*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabs"
503*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
504*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of complex type}}
505*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
506*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
507*0a6a1f1dSLionel Sambuc 
508*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
509*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabs' instead}}
511*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabs"
512*0a6a1f1dSLionel Sambuc   (void)cabs(x);
513*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
514*0a6a1f1dSLionel Sambuc 
515*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
516*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of complex type}}
517*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
518*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_cabs"
519*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
520*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of complex type}}
521*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
522*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabs"
523*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
524*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of complex type}}
525*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
526*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
527*0a6a1f1dSLionel Sambuc 
528*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
529*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of complex type}}
530*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
531*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
532*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
533*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of complex type}}
534*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
535*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabs"
536*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
537*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of complex type}}
538*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
539*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
540*0a6a1f1dSLionel Sambuc 
541*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
542*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabs' instead}}
544*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabs"
545*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
546*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
547*0a6a1f1dSLionel Sambuc }
548*0a6a1f1dSLionel Sambuc 
test_complex_long_double(_Complex long double x)549*0a6a1f1dSLionel Sambuc void test_complex_long_double(_Complex long double x) {
550*0a6a1f1dSLionel Sambuc   (void)abs(x);
551*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'abs' when argument is of complex type}}
552*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
553*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:"cabsl"
554*0a6a1f1dSLionel Sambuc   (void)labs(x);
555*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'labs' when argument is of complex type}}
556*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
557*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsl"
558*0a6a1f1dSLionel Sambuc   (void)llabs(x);
559*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function 'llabs' when argument is of complex type}}
560*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
561*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
562*0a6a1f1dSLionel Sambuc 
563*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
564*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsf' when argument is of complex type}}
565*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
566*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
567*0a6a1f1dSLionel Sambuc   (void)fabs(x);
568*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabs' when argument is of complex type}}
569*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
570*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsl"
571*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
572*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function 'fabsl' when argument is of complex type}}
573*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
574*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
575*0a6a1f1dSLionel Sambuc 
576*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
577*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
579*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:"cabsl"
580*0a6a1f1dSLionel Sambuc   (void)cabs(x);
581*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function 'cabsl' instead}}
583*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:"cabsl"
584*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
585*0a6a1f1dSLionel Sambuc 
586*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
587*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_abs' when argument is of complex type}}
588*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
589*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:"__builtin_cabsl"
590*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
591*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_labs' when argument is of complex type}}
592*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
593*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsl"
594*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
595*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using integer absolute value function '__builtin_llabs' when argument is of complex type}}
596*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
597*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
598*0a6a1f1dSLionel Sambuc 
599*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
600*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsf' when argument is of complex type}}
601*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
602*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
603*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
604*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabs' when argument is of complex type}}
605*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
606*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsl"
607*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
608*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{using floating point absolute value function '__builtin_fabsl' when argument is of complex type}}
609*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
610*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
611*0a6a1f1dSLionel Sambuc 
612*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
613*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
615*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:"__builtin_cabsl"
616*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
617*0a6a1f1dSLionel Sambuc   // 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*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{use function '__builtin_cabsl' instead}}
619*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:"__builtin_cabsl"
620*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
621*0a6a1f1dSLionel Sambuc }
622*0a6a1f1dSLionel Sambuc 
test_unsigned_int(unsigned int x)623*0a6a1f1dSLionel Sambuc void test_unsigned_int(unsigned int x) {
624*0a6a1f1dSLionel Sambuc   (void)abs(x);
625*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
626*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'abs' since unsigned values cannot be negative}}
627*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:""
628*0a6a1f1dSLionel Sambuc   (void)labs(x);
629*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
630*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'labs' since unsigned values cannot be negative}}
631*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
632*0a6a1f1dSLionel Sambuc   (void)llabs(x);
633*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
634*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'llabs' since unsigned values cannot be negative}}
635*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
636*0a6a1f1dSLionel Sambuc 
637*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
638*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
639*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'fabsf' since unsigned values cannot be negative}}
640*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
641*0a6a1f1dSLionel Sambuc   (void)fabs(x);
642*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
643*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'fabs' since unsigned values cannot be negative}}
644*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
645*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
646*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
647*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'fabsl' since unsigned values cannot be negative}}
648*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
649*0a6a1f1dSLionel Sambuc 
650*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
651*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
652*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'cabsf' since unsigned values cannot be negative}}
653*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
654*0a6a1f1dSLionel Sambuc   (void)cabs(x);
655*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
656*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'cabs' since unsigned values cannot be negative}}
657*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
658*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
659*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
660*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'cabsl' since unsigned values cannot be negative}}
661*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
662*0a6a1f1dSLionel Sambuc 
663*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
664*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
665*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_abs' since unsigned values cannot be negative}}
666*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:""
667*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
668*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
669*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_labs' since unsigned values cannot be negative}}
670*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
671*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
672*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
673*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_llabs' since unsigned values cannot be negative}}
674*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
675*0a6a1f1dSLionel Sambuc 
676*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
677*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
678*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_fabsf' since unsigned values cannot be negative}}
679*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
680*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
681*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
682*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_fabs' since unsigned values cannot be negative}}
683*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
684*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
685*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
686*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_fabsl' since unsigned values cannot be negative}}
687*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
688*0a6a1f1dSLionel Sambuc 
689*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
690*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
691*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_cabsf' since unsigned values cannot be negative}}
692*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
693*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
694*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
695*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_cabs' since unsigned values cannot be negative}}
696*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
697*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
698*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned int' has no effect}}
699*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_cabsl' since unsigned values cannot be negative}}
700*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
701*0a6a1f1dSLionel Sambuc }
702*0a6a1f1dSLionel Sambuc 
test_unsigned_long(unsigned long x)703*0a6a1f1dSLionel Sambuc void test_unsigned_long(unsigned long x) {
704*0a6a1f1dSLionel Sambuc   (void)abs(x);
705*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
706*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'abs' since unsigned values cannot be negative}}
707*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:""
708*0a6a1f1dSLionel Sambuc   (void)labs(x);
709*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
710*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'labs' since unsigned values cannot be negative}}
711*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
712*0a6a1f1dSLionel Sambuc   (void)llabs(x);
713*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
714*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'llabs' since unsigned values cannot be negative}}
715*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
716*0a6a1f1dSLionel Sambuc 
717*0a6a1f1dSLionel Sambuc   (void)fabsf(x);
718*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
719*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'fabsf' since unsigned values cannot be negative}}
720*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
721*0a6a1f1dSLionel Sambuc   (void)fabs(x);
722*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
723*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'fabs' since unsigned values cannot be negative}}
724*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
725*0a6a1f1dSLionel Sambuc   (void)fabsl(x);
726*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
727*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'fabsl' since unsigned values cannot be negative}}
728*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
729*0a6a1f1dSLionel Sambuc 
730*0a6a1f1dSLionel Sambuc   (void)cabsf(x);
731*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
732*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'cabsf' since unsigned values cannot be negative}}
733*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
734*0a6a1f1dSLionel Sambuc   (void)cabs(x);
735*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
736*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'cabs' since unsigned values cannot be negative}}
737*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:13}:""
738*0a6a1f1dSLionel Sambuc   (void)cabsl(x);
739*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
740*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to 'cabsl' since unsigned values cannot be negative}}
741*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:14}:""
742*0a6a1f1dSLionel Sambuc 
743*0a6a1f1dSLionel Sambuc   (void)__builtin_abs(x);
744*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
745*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_abs' since unsigned values cannot be negative}}
746*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:22}:""
747*0a6a1f1dSLionel Sambuc   (void)__builtin_labs(x);
748*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
749*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_labs' since unsigned values cannot be negative}}
750*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
751*0a6a1f1dSLionel Sambuc   (void)__builtin_llabs(x);
752*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
753*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_llabs' since unsigned values cannot be negative}}
754*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
755*0a6a1f1dSLionel Sambuc 
756*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsf(x);
757*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
758*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_fabsf' since unsigned values cannot be negative}}
759*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
760*0a6a1f1dSLionel Sambuc   (void)__builtin_fabs(x);
761*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
762*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_fabs' since unsigned values cannot be negative}}
763*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
764*0a6a1f1dSLionel Sambuc   (void)__builtin_fabsl(x);
765*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
766*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_fabsl' since unsigned values cannot be negative}}
767*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
768*0a6a1f1dSLionel Sambuc 
769*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsf(x);
770*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
771*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_cabsf' since unsigned values cannot be negative}}
772*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
773*0a6a1f1dSLionel Sambuc   (void)__builtin_cabs(x);
774*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
775*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_cabs' since unsigned values cannot be negative}}
776*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:23}:""
777*0a6a1f1dSLionel Sambuc   (void)__builtin_cabsl(x);
778*0a6a1f1dSLionel Sambuc   // expected-warning@-1 {{taking the absolute value of unsigned type 'unsigned long' has no effect}}
779*0a6a1f1dSLionel Sambuc   // expected-note@-2 {{remove the call to '__builtin_cabsl' since unsigned values cannot be negative}}
780*0a6a1f1dSLionel Sambuc   // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:24}:""
781*0a6a1f1dSLionel Sambuc }
782*0a6a1f1dSLionel Sambuc 
783