From f3fce920ff48eb643aa25cb71dc0b1013d86c672 Mon Sep 17 00:00:00 2001 From: Roger Ferrer Ibanez Date: Thu, 1 Dec 2016 17:34:57 +0000 Subject: [PATCH] Protect futures test under libcpp-no-exceptions Skip tests that expect an exception be thrown. Differential Revision: https://reviews.llvm.org/D27253 llvm-svn: 288382 --- .../thread/futures/futures.promise/move_assign.pass.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp index 9dd8a9daef80..ad72bf78e0a4 100644 --- a/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 @@ -20,6 +19,7 @@ #include #include +#include "test_macros.h" #include "test_allocator.h" int main() @@ -34,6 +34,7 @@ int main() std::future f = p.get_future(); assert(test_alloc_base::alloc_count == 1); assert(f.valid()); +#ifndef TEST_HAS_NO_EXCEPTIONS try { f = p0.get_future(); @@ -43,6 +44,7 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } +#endif assert(test_alloc_base::alloc_count == 1); } assert(test_alloc_base::alloc_count == 0); @@ -55,6 +57,7 @@ int main() std::future f = p.get_future(); assert(test_alloc_base::alloc_count == 1); assert(f.valid()); +#ifndef TEST_HAS_NO_EXCEPTIONS try { f = p0.get_future(); @@ -64,6 +67,7 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } +#endif assert(test_alloc_base::alloc_count == 1); } assert(test_alloc_base::alloc_count == 0); @@ -76,6 +80,7 @@ int main() std::future f = p.get_future(); assert(test_alloc_base::alloc_count == 1); assert(f.valid()); +#ifndef TEST_HAS_NO_EXCEPTIONS try { f = p0.get_future(); @@ -85,6 +90,7 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } +#endif assert(test_alloc_base::alloc_count == 1); } assert(test_alloc_base::alloc_count == 0);