[libcxx] Recover no-exceptions XFAILs - I
First batch of changes to get some of these XFAILs working in the
no-exceptions libc++ variant.
Changed some XFAILs to UNSUPPORTED where the test is all about exception
handling. In other cases, used the test macros TEST_THROW and
TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test
that concerns exception handling behaviour.
Reviewers: EricWF, mclow.lists
Differential revision: https://reviews.llvm.org/D24562
llvm-svn: 283441
diff --git a/libcxx/test/std/thread/futures/futures.async/async.pass.cpp b/libcxx/test/std/thread/futures/futures.async/async.pass.cpp
index 5cb824d..5a5ff9d 100644
--- a/libcxx/test/std/thread/futures/futures.async/async.pass.cpp
+++ b/libcxx/test/std/thread/futures/futures.async/async.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
//
-// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
@@ -73,7 +72,7 @@
void f5(int j)
{
std::this_thread::sleep_for(ms(200));
- throw j;
+ TEST_THROW(j);
}
template <class Ret, class CheckLamdba, class ...Args>
@@ -140,6 +139,7 @@
test<Ret>(checkUPtr, DPID, f3, 3);
test<Ret>(checkUPtr, DPID, f4, std::unique_ptr<int>(new int(3)));
}
+#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::future<void> f = std::async(f5, 3);
std::this_thread::sleep_for(ms(300));
@@ -150,4 +150,5 @@
std::this_thread::sleep_for(ms(300));
try { f.get(); assert (false); } catch ( int ) {}
}
+#endif
}