From c37a49896a414b5dcea12a637283f07dd80f0ec6 Mon Sep 17 00:00:00 2001 From: David Sheinkman Date: Fri, 14 Oct 2016 20:43:37 +0000 Subject: [PATCH] __builtin_fpclassify missing one int parameter Patch by Tania Albarghouthi. Differential Revision: https://reviews.llvm.org/D25480 llvm-svn: 284277 --- clang/include/clang/Basic/Builtins.def | 2 +- clang/test/Sema/builtin-unary-fp.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def index c39656cd1b4a..b1f8253fba7a 100644 --- a/clang/include/clang/Basic/Builtins.def +++ b/clang/include/clang/Basic/Builtins.def @@ -367,7 +367,7 @@ BUILTIN(__builtin_islessgreater , "i.", "Fnc") 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") diff --git a/clang/test/Sema/builtin-unary-fp.c b/clang/test/Sema/builtin-unary-fp.c index 57568db8ae3f..2b75b10fcbe5 100644 --- a/clang/test/Sema/builtin-unary-fp.c +++ b/clang/test/Sema/builtin-unary-fp.c @@ -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}} }