1 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -verify %s -Wabsolute-value
2 // RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only %s -Wabsolute-value -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
8 // expected-warning@-1{{incompatible redeclaration of library function 'fabsf'}}
9 // expected-note@-2{{'fabsf' is a builtin with type 'float (float)'}}
11 void test_int(int i
, unsigned u
, long long ll
, float f
, double d
) {
16 // expected-warning@-1{{taking the absolute value of unsigned type 'unsigned int' has no effect}}
17 // expected-note@-2{{remove the call to 'abs' since unsigned values cannot be negative}}
18 // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:9-[[@LINE-3]]:12}:""
22 // Conflict in names, no notes
24 // 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}}
26 // Conflict in names, no notes
28 // expected-warning@-1{{using integer absolute value function 'abs' when argument is of floating point type}}
32 // expected-warning@-1{{using integer absolute value function 'abs' when argument is of floating point type}}
33 // expected-note@-2{{use function 'fabs' instead}}
34 // expected-note@-3{{include the header <math.h> or explicitly provide a declaration for 'fabs'}}
35 // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:9-[[@LINE-4]]:12}:"fabs"