r284277 - __builtin_fpclassify missing one int parameter
David Sheinkman via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 14 13:43:37 PDT 2016
Author: davidsh
Date: Fri Oct 14 15:43:37 2016
New Revision: 284277
URL: http://llvm.org/viewvc/llvm-project?rev=284277&view=rev
Log:
__builtin_fpclassify missing one int parameter
Patch by Tania Albarghouthi.
Differential Revision: https://reviews.llvm.org/D25480
Modified:
cfe/trunk/include/clang/Basic/Builtins.def
cfe/trunk/test/Sema/builtin-unary-fp.c
Modified: cfe/trunk/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=284277&r1=284276&r2=284277&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.def (original)
+++ cfe/trunk/include/clang/Basic/Builtins.def Fri Oct 14 15:43:37 2016
@@ -367,7 +367,7 @@ BUILTIN(__builtin_islessgreater , "i.",
BUILTIN(__builtin_isunordered , "i.", "Fnc")
// Unary FP classification
-BUILTIN(__builtin_fpclassify, "iiiii.", "Fnc")
+BUILTIN(__builtin_fpclassify, "iiiiii.", "Fnc")
BUILTIN(__builtin_isfinite, "i.", "Fnc")
BUILTIN(__builtin_isinf, "i.", "Fnc")
BUILTIN(__builtin_isinf_sign, "i.", "Fnc")
Modified: cfe/trunk/test/Sema/builtin-unary-fp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtin-unary-fp.c?rev=284277&r1=284276&r2=284277&view=diff
==============================================================================
--- cfe/trunk/test/Sema/builtin-unary-fp.c (original)
+++ cfe/trunk/test/Sema/builtin-unary-fp.c Fri Oct 14 15:43:37 2016
@@ -11,6 +11,7 @@ void a() {
check(__builtin_isnan(1,2)); // expected-error{{too many arguments}}
check(__builtin_fpclassify(0, 0, 0, 0, 0, 1.0));
check(__builtin_fpclassify(0, 0, 0, 0, 0, 1)); // expected-error{{requires argument of floating point type}}
+ check(__builtin_fpclassify(0, 1, 2, 3, 4.5, 5.0)); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 4.5 to 4}}
check(__builtin_fpclassify(0, 0, 0, 0, 1)); // expected-error{{too few arguments}}
check(__builtin_fpclassify(0, 0, 0, 0, 0, 1, 0)); // expected-error{{too many arguments}}
}
More information about the cfe-commits
mailing list