| OLD | NEW |
| 1 //===----------------------------------------------------------------------===// | 1 //===----------------------------------------------------------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is dual licensed under the MIT and the University of Illinois Open | 5 // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 // Source Licenses. See LICENSE.TXT for details. | 6 // Source Licenses. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 | 9 |
| 10 // test numeric_limits | 10 // test numeric_limits |
| 11 | 11 |
| 12 // traps | 12 // traps |
| 13 | 13 |
| 14 #include <limits> | 14 #include <limits> |
| 15 | 15 |
| 16 #if (defined(__i386__) || defined(__x86_64__)) | 16 #if (defined(__i386__) || defined(__x86_64__)) || defined(__pnacl__) // @LOCALMO
D |
| 17 static const bool integral_types_trap = true; | 17 static const bool integral_types_trap = true; |
| 18 #else | 18 #else |
| 19 static const bool integral_types_trap = false; | 19 static const bool integral_types_trap = false; |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 template <class T, bool expected> | 22 template <class T, bool expected> |
| 23 void | 23 void |
| 24 test() | 24 test() |
| 25 { | 25 { |
| 26 static_assert(std::numeric_limits<T>::traps == expected, "traps test 1"); | 26 static_assert(std::numeric_limits<T>::traps == expected, "traps test 1"); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 test<long long, integral_types_trap>(); | 49 test<long long, integral_types_trap>(); |
| 50 test<unsigned long long, integral_types_trap>(); | 50 test<unsigned long long, integral_types_trap>(); |
| 51 #ifndef _LIBCPP_HAS_NO_INT128 | 51 #ifndef _LIBCPP_HAS_NO_INT128 |
| 52 test<__int128_t, integral_types_trap>(); | 52 test<__int128_t, integral_types_trap>(); |
| 53 test<__uint128_t, integral_types_trap>(); | 53 test<__uint128_t, integral_types_trap>(); |
| 54 #endif | 54 #endif |
| 55 test<float, false>(); | 55 test<float, false>(); |
| 56 test<double, false>(); | 56 test<double, false>(); |
| 57 test<long double, false>(); | 57 test<long double, false>(); |
| 58 } | 58 } |
| OLD | NEW |