llvm-project/libcxx/test/std/numerics/c.math
Duncan P. N. Exon Smith 42f8eee150 cmath: Skip Libc for integral types in isinf, etc.
For std::isinf, the standard requires effectively calling isinf as
double from Libc for integral types. But integral types are never
infinite; we don't need to call Libc to return false.

Also short-circuit other functions where Libc won't have interesting
answers: signbit, fpclassify, isfinite, isnan, and isnormal.

I added correctness tests for integral types since we're no longer
deferring to Libc.

In review it was pointed out that in future revisions of the C++
standard we may add more types to std::is_arithmetic (e.g.,
std::is_fixed_point).  I'll leave it to a future commit to hack this to
allow using math functions on those.  We'll need to change things like
__libcpp_fpclassify anyway, so I'm not sure anything here would really
be future-proof.

https://reviews.llvm.org/D31561
rdar://problem/31361223

llvm-svn: 301060
2017-04-21 23:14:55 +00:00
..
cmath.pass.cpp cmath: Skip Libc for integral types in isinf, etc. 2017-04-21 23:14:55 +00:00
ctgmath.pass.cpp [libcxx] [test] D26314: Fix MSVC warning C4189 "local variable is initialized but not referenced". 2016-11-14 17:35:14 +00:00
tgmath_h.pass.cpp Remove all _LIBCPP_VERSION tests from under test/std 2016-10-08 01:32:56 +00:00