From 53a420fba21cf1644972b34dcd811a43cdb8368d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:58 +0000 Subject: Vendor import of libc++ trunk r290819: https://llvm.org/svn/llvm-project/libcxx/trunk@290819 --- test/std/strings/string.conversions/stold.pass.cpp | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'test/std/strings/string.conversions/stold.pass.cpp') diff --git a/test/std/strings/string.conversions/stold.pass.cpp b/test/std/strings/string.conversions/stold.pass.cpp index f489df2f124da..9d9dc3832ba68 100644 --- a/test/std/strings/string.conversions/stold.pass.cpp +++ b/test/std/strings/string.conversions/stold.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // long double stold(const string& str, size_t *idx = 0); @@ -19,6 +18,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stold("0") == 0); @@ -35,25 +36,32 @@ int main() idx = 0; assert(std::stold(L"10g", &idx) == 10); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stold("1.e60", &idx) == 1.e60L); assert(idx == 5); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } try +#endif { assert(std::stold(L"1.e60", &idx) == 1.e60L); assert(idx == 5); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try { assert(std::stold("1.e6000", &idx) == INFINITY); @@ -73,40 +81,54 @@ int main() assert(idx == 0); } try +#endif { assert(std::stold("INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stold(L"INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stold("NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stold(L"NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); @@ -166,4 +188,5 @@ int main() { assert(idx == 0); } +#endif } -- cgit v1.2.3