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