Eric Fiselier | 95b0d0f | 2014-08-09 02:39:03 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <cmath> |
| 11 | |
Eric Fiselier | f5f5862 | 2014-08-09 02:43:16 +0000 | [diff] [blame] | 12 | // isnan |
Eric Fiselier | 95b0d0f | 2014-08-09 02:39:03 +0000 | [diff] [blame] | 13 | |
| 14 | // XFAIL: linux |
| 15 | |
| 16 | #include <cmath> |
| 17 | #include <type_traits> |
| 18 | #include <cassert> |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | #ifdef isnan |
| 23 | #error isnan defined |
| 24 | #endif |
| 25 | static_assert((std::is_same<decltype(std::isnan((float)0)), bool>::value), ""); |
| 26 | static_assert((std::is_same<decltype(std::isnan((double)0)), bool>::value), ""); |
| 27 | static_assert((std::is_same<decltype(std::isnan(0)), bool>::value), ""); |
| 28 | static_assert((std::is_same<decltype(std::isnan((long double)0)), bool>::value), ""); |
| 29 | assert(std::isnan(-1.0) == false); |
| 30 | } |