annotate clang/test/Sema/warn-absolute-value.c @ 150:1d019706d866

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