[PATCH] D25480: __builtin_fpclassify missing one int parameter
Tania Albarghouthi via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 12 07:53:15 PDT 2016
taniabarg updated this revision to Diff 74377.
taniabarg added a comment.
Added test to test/Sema/builtin-unary-fp.c that will fail without the proposed change (without the change, the test will -not- attempt to implicitly cast the 5th parameter to int).
https://reviews.llvm.org/D25480
Files:
include/clang/Basic/Builtins.def
test/Sema/builtin-unary-fp.c
Index: test/Sema/builtin-unary-fp.c
===================================================================
--- test/Sema/builtin-unary-fp.c
+++ test/Sema/builtin-unary-fp.c
@@ -11,6 +11,7 @@
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}}
}
Index: include/clang/Basic/Builtins.def
===================================================================
--- include/clang/Basic/Builtins.def
+++ include/clang/Basic/Builtins.def
@@ -367,7 +367,7 @@
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")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25480.74377.patch
Type: text/x-patch
Size: 1262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161012/1f2aa5fa/attachment.bin>
More information about the cfe-commits
mailing list