Index: test/std/depr/depr.c.headers/math_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/math_h.pass.cpp +++ test/std/depr/depr.c.headers/math_h.pass.cpp @@ -9,9 +9,6 @@ // -// NOTE: isinf and isnan are tested separately because they are expected to fail -// on linux. We don't want their expected failure to hide other failures in this file. - #include #include #include @@ -631,6 +628,29 @@ assert(isgreaterequal(-1.0, 0.F) == false); } +void test_isinf() +{ +#ifdef isinf +#error isinf defined +#endif + static_assert((std::is_same::value), ""); + + typedef decltype(isinf((double)0)) DoubleRetType; +#ifndef __linux__ + static_assert((std::is_same::value), ""); +#else + // GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this. + // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 + static_assert((std::is_same::value + || std::is_same::value), ""); +#endif + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(isinf(-1.0) == false); +} + void test_isless() { #ifdef isless @@ -688,6 +708,29 @@ assert(islessgreater(-1.0, 0.F) == true); } +void test_isnan() +{ +#ifdef isnan +#error isnan defined +#endif + static_assert((std::is_same::value), ""); + + typedef decltype(isnan((double)0)) DoubleRetType; +#ifndef __linux__ + static_assert((std::is_same::value), ""); +#else + // GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this. + // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 + static_assert((std::is_same::value + || std::is_same::value), ""); +#endif + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(isnan(-1.0) == false); +} + void test_isunordered() { #ifdef isunordered @@ -1443,9 +1486,11 @@ test_isnormal(); test_isgreater(); test_isgreaterequal(); + test_isinf(); test_isless(); test_islessequal(); test_islessgreater(); + test_isnan(); test_isunordered(); test_acosh(); test_asinh(); Index: test/std/depr/depr.c.headers/math_h_isinf.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/math_h_isinf.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// - -// isinf - -// XFAIL: linux - -#include -#include -#include - -int main() -{ -#ifdef isinf -#error isinf defined -#endif - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(isinf(-1.0) == false); -} Index: test/std/depr/depr.c.headers/math_h_isnan.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/math_h_isnan.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// - -// isnan - -// XFAIL: linux - -#include -#include -#include - -int main() -{ -#ifdef isnan -#error isnan defined -#endif - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(isnan(-1.0) == false); -} Index: test/std/numerics/c.math/cmath.pass.cpp =================================================================== --- test/std/numerics/c.math/cmath.pass.cpp +++ test/std/numerics/c.math/cmath.pass.cpp @@ -9,9 +9,6 @@ // -// NOTE: isinf and isnan are tested separately because they are expected to fail -// on linux. We don't want their expected failure to hide other failures in this file. - #include #include #include @@ -631,6 +628,29 @@ assert(std::isgreaterequal(-1.0, 0.F) == false); } +void test_isinf() +{ +#ifdef isinf +#error isinf defined +#endif + static_assert((std::is_same::value), ""); + + typedef decltype(std::isinf((double)0)) DoubleRetType; +#ifndef __linux__ + static_assert((std::is_same::value), ""); +#else + // GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this. + // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 + static_assert((std::is_same::value + || std::is_same::value), ""); +#endif + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(std::isinf(-1.0) == false); +} + void test_isless() { #ifdef isless @@ -688,6 +708,29 @@ assert(std::islessgreater(-1.0, 0.F) == true); } +void test_isnan() +{ +#ifdef isnan +#error isnan defined +#endif + static_assert((std::is_same::value), ""); + + typedef decltype(std::isnan((double)0)) DoubleRetType; +#ifndef __linux__ + static_assert((std::is_same::value), ""); +#else + // GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in + // all C++ dialects. The test should tolerate this. + // See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439 + static_assert((std::is_same::value + || std::is_same::value), ""); +#endif + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(std::isnan(-1.0) == false); +} + void test_isunordered() { #ifdef isunordered @@ -1443,9 +1486,11 @@ test_isnormal(); test_isgreater(); test_isgreaterequal(); + test_isinf(); test_isless(); test_islessequal(); test_islessgreater(); + test_isnan(); test_isunordered(); test_acosh(); test_asinh(); Index: test/std/numerics/c.math/cmath_isinf.pass.cpp =================================================================== --- test/std/numerics/c.math/cmath_isinf.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// - -// isinf - -// XFAIL: linux - -#include -#include -#include - -int main() -{ -#ifdef isinf -#error isinf defined -#endif - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(std::isinf(-1.0) == false); -} \ No newline at end of file Index: test/std/numerics/c.math/cmath_isnan.pass.cpp =================================================================== --- test/std/numerics/c.math/cmath_isnan.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// - -// isnan - -// XFAIL: linux - -#include -#include -#include - -int main() -{ -#ifdef isnan -#error isnan defined -#endif - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(std::isnan(-1.0) == false); -}