[libcxx] r283441 - [libcxx] Recover no-exceptions XFAILs - I

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 04:15:42 PDT 2016


Author: asiri
Date: Thu Oct  6 06:15:41 2016
New Revision: 283441

URL: http://llvm.org/viewvc/llvm-project?rev=283441&view=rev
Log:
[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

Modified:
    libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp
    libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
    libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
    libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/dtor.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/get_future.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/move_ctor.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/set_exception.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/set_value_const.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.promise/set_value_void.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.shared_future/get.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp
    libcxx/trunk/test/std/thread/futures/futures.unique_future/get.pass.cpp
    libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp

Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/grep.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <regex>
 
 // template <class BidirectionalIterator, class Allocator, class charT, class traits>
@@ -25,6 +24,7 @@
 
 extern "C" void LLVMFuzzerTestOneInput(const char *data)
 {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     size_t size = strlen(data);
     if (size > 0)
     {
@@ -37,6 +37,7 @@ extern "C" void LLVMFuzzerTestOneInput(c
         }
         catch (std::regex_error &) {}
     }
+#endif
 }
 
 

Modified: libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
 // <regex>
 
 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
@@ -27,6 +26,7 @@ int main()
     assert(r2.mark_count() == 2);
     assert(std::regex_search("ab", r2));
 
+#ifndef TEST_HAS_NO_EXCEPTIONS
     bool caught = false;
     try { r2.assign("(def", std::regex::extended); }
     catch(std::regex_error &) { caught = true; }
@@ -34,4 +34,5 @@ int main()
     assert(r2.flags() == std::regex::ECMAScript);
     assert(r2.mark_count() == 2);
     assert(std::regex_search("ab", r2));
+#endif
 }

Modified: libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
 // <regex>
 
 // template <class charT, class traits = regex_traits<charT>> class basic_regex;

Modified: libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.regex/re.regex.construct/bad_repeat.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
 // <regex>
 
 // template <class charT, class traits = regex_traits<charT>> class basic_regex;

Modified: libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.async/async.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -73,7 +72,7 @@ std::unique_ptr<int> f4(std::unique_ptr<
 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 @@ int main()
         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 @@ int main()
         std::this_thread::sleep_for(ms(300));
         try { f.get(); assert (false); } catch ( int ) {}
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/dtor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/dtor.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/dtor.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/dtor.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 int main()
 {
     {
@@ -32,6 +33,7 @@ int main()
         }
         assert(f.get() == 3);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         typedef int T;
         std::future<T> f;
@@ -49,6 +51,7 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::broken_promise));
         }
     }
+#endif
 
     {
         typedef int& T;
@@ -61,6 +64,7 @@ int main()
         }
         assert(&f.get() == &i);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         typedef int& T;
         std::future<T> f;
@@ -78,6 +82,7 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::broken_promise));
         }
     }
+#endif
 
     {
         typedef void T;
@@ -90,6 +95,7 @@ int main()
         f.get();
         assert(true);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         typedef void T;
         std::future<T> f;
@@ -115,4 +121,5 @@ int main()
                 e.code() == std::error_code(0, std::future_category()));
         }
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/get_future.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/get_future.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/get_future.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/get_future.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 int main()
 {
     {
@@ -28,6 +29,7 @@ int main()
         p.set_value(105.5);
         assert(f.get() == 105.5);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::promise<double> p;
         std::future<double> f = p.get_future();
@@ -54,4 +56,5 @@ int main()
             assert(e.code() ==  make_error_code(std::future_errc::no_state));
         }
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/move_ctor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/move_ctor.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/move_ctor.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/move_ctor.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,7 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
 #include "test_allocator.h"
 
 int main()
@@ -32,6 +32,7 @@ int main()
         std::future<int> f = p.get_future();
         assert(test_alloc_base::alloc_count == 1);
         assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             f = p0.get_future();
@@ -42,6 +43,7 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
         assert(test_alloc_base::alloc_count == 1);
+#endif
     }
     assert(test_alloc_base::alloc_count == 0);
     {
@@ -51,6 +53,7 @@ int main()
         std::future<int&> f = p.get_future();
         assert(test_alloc_base::alloc_count == 1);
         assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             f = p0.get_future();
@@ -61,6 +64,7 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
         assert(test_alloc_base::alloc_count == 1);
+#endif
     }
     assert(test_alloc_base::alloc_count == 0);
     {
@@ -70,6 +74,7 @@ int main()
         std::future<void> f = p.get_future();
         assert(test_alloc_base::alloc_count == 1);
         assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             f = p0.get_future();
@@ -80,6 +85,7 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
         assert(test_alloc_base::alloc_count == 1);
+#endif
     }
     assert(test_alloc_base::alloc_count == 0);
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/set_exception.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/set_exception.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/set_exception.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/set_exception.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 int main()
 {
     {
@@ -32,6 +33,7 @@ int main()
         assert(j == 3);
         ++i;
         assert(j == 4);
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             p.set_value(i);
@@ -41,5 +43,6 @@ int main()
         {
             assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
         }
+#endif
     }
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/set_value_const.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/set_value_const.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/set_value_const.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/set_value_const.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,10 +19,14 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 struct A
 {
     A() {}
-    A(const A&) {throw 10;}
+    A(const A&) {
+        TEST_THROW(10);
+    }
 };
 
 int main()
@@ -36,6 +39,7 @@ int main()
         p.set_value(i);
         ++i;
         assert(f.get() == 3);
+#ifndef TEST_HAS_NO_EXCEPTIONS
         --i;
         try
         {
@@ -46,12 +50,14 @@ int main()
         {
             assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
         }
+#endif
     }
     {
         typedef A T;
         T i;
         std::promise<T> p;
         std::future<T> f = p.get_future();
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             p.set_value(i);
@@ -61,5 +67,6 @@ int main()
         {
             assert(j == 10);
         }
+#endif
     }
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.promise/set_value_void.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/set_value_void.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/set_value_void.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/set_value_void.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
+// UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 

Modified: libcxx/trunk/test/std/thread/futures/futures.shared_future/get.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.shared_future/get.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.shared_future/get.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.shared_future/get.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -22,6 +21,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 void func1(std::promise<int> p)
 {
     std::this_thread::sleep_for(std::chrono::milliseconds(500));
@@ -73,6 +74,7 @@ int main()
             assert(f.get() == 3);
             assert(f.valid());
         }
+#ifndef TEST_HAS_NO_EXCEPTIONS
         {
             std::promise<T> p;
             std::shared_future<T> f = p.get_future();
@@ -89,6 +91,7 @@ int main()
             }
             assert(f.valid());
         }
+#endif
     }
     {
         typedef int& T;
@@ -100,6 +103,7 @@ int main()
             assert(f.get() == 5);
             assert(f.valid());
         }
+#ifndef TEST_HAS_NO_EXCEPTIONS
         {
             std::promise<T> p;
             std::shared_future<T> f = p.get_future();
@@ -116,6 +120,7 @@ int main()
             }
             assert(f.valid());
         }
+#endif
     }
     {
         typedef void T;
@@ -127,6 +132,7 @@ int main()
             f.get();
             assert(f.valid());
         }
+#ifndef TEST_HAS_NO_EXCEPTIONS
         {
             std::promise<T> p;
             std::shared_future<T> f = p.get_future();
@@ -143,5 +149,6 @@ int main()
             }
             assert(f.valid());
         }
+#endif
     }
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/dtor.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     long data_;
@@ -41,6 +42,7 @@ void func2(std::packaged_task<double(int
 
 int main()
 {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::packaged_task<double(int, char)> p(A(5));
         std::future<double> f = p.get_future();
@@ -55,6 +57,7 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::broken_promise));
         }
     }
+#endif
     {
         std::packaged_task<double(int, char)> p(A(5));
         std::future<double> f = p.get_future();

Modified: libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/get_future.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     long data_;
@@ -38,6 +39,7 @@ int main()
         p(3, 'a');
         assert(f.get() == 105.0);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::packaged_task<double(int, char)> p(A(5));
         std::future<double> f = p.get_future();
@@ -63,4 +65,5 @@ int main()
             assert(e.code() ==  make_error_code(std::future_errc::no_state));
         }
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     long data_;
@@ -30,7 +31,7 @@ public:
     long operator()(long i, long j) const
     {
         if (j == 'z')
-            throw A(6);
+            TEST_THROW(A(6));
         return data_ + i + j;
     }
 };
@@ -49,6 +50,7 @@ void func1(std::packaged_task<double(int
 
 void func2(std::packaged_task<double(int, char)> p)
 {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     p.make_ready_at_thread_exit(3, 'a');
     try
     {
@@ -58,10 +60,12 @@ void func2(std::packaged_task<double(int
     {
         assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
     }
+#endif
 }
 
 void func3(std::packaged_task<double(int, char)> p)
 {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     try
     {
         p.make_ready_at_thread_exit(3, 'a');
@@ -70,6 +74,7 @@ void func3(std::packaged_task<double(int
     {
         assert(e.code() == make_error_code(std::future_errc::no_state));
     }
+#endif
 }
 
 int main()
@@ -80,6 +85,7 @@ int main()
         std::thread(func0, std::move(p)).detach();
         assert(f.get() == 105.0);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::packaged_task<double(int, char)> p(A(5));
         std::future<double> f = p.get_future();
@@ -105,4 +111,5 @@ int main()
         std::thread t(func3, std::move(p));
         t.join();
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/operator.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     long data_;
@@ -30,7 +31,7 @@ public:
     long operator()(long i, long j) const
     {
         if (j == 'z')
-            throw A(6);
+            TEST_THROW(A(6));
         return data_ + i + j;
     }
 };
@@ -49,6 +50,7 @@ void func1(std::packaged_task<double(int
 
 void func2(std::packaged_task<double(int, char)> p)
 {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     p(3, 'a');
     try
     {
@@ -58,10 +60,12 @@ void func2(std::packaged_task<double(int
     {
         assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
     }
+#endif
 }
 
 void func3(std::packaged_task<double(int, char)> p)
 {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     try
     {
         p(3, 'a');
@@ -70,6 +74,7 @@ void func3(std::packaged_task<double(int
     {
         assert(e.code() == make_error_code(std::future_errc::no_state));
     }
+#endif
 }
 
 int main()
@@ -80,6 +85,7 @@ int main()
         std::thread(func0, std::move(p)).detach();
         assert(f.get() == 105.0);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::packaged_task<double(int, char)> p(A(5));
         std::future<double> f = p.get_future();
@@ -106,4 +112,5 @@ int main()
         std::thread t(func3, std::move(p));
         t.join();
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.task/futures.task.members/reset.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 class A
 {
     long data_;
@@ -29,8 +30,6 @@ public:
 
     long operator()(long i, long j) const
     {
-        if (j == 'z')
-            throw A(6);
         return data_ + i + j;
     }
 };
@@ -47,6 +46,7 @@ int main()
         f = p.get_future();
         assert(f.get() == 106.0);
     }
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::packaged_task<double(int, char)> p;
         try
@@ -59,4 +59,5 @@ int main()
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
     }
+#endif
 }

Modified: libcxx/trunk/test/std/thread/futures/futures.unique_future/get.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.unique_future/get.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.unique_future/get.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.unique_future/get.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -22,6 +21,8 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
+
 void func1(std::promise<int> p)
 {
     std::this_thread::sleep_for(std::chrono::milliseconds(500));
@@ -73,6 +74,7 @@ int main()
             assert(f.get() == 3);
             assert(!f.valid());
         }
+#ifndef TEST_HAS_NO_EXCEPTIONS
         {
             std::promise<T> p;
             std::future<T> f = p.get_future();
@@ -89,6 +91,7 @@ int main()
             }
             assert(!f.valid());
         }
+#endif
     }
     {
         typedef int& T;
@@ -100,6 +103,7 @@ int main()
             assert(f.get() == 5);
             assert(!f.valid());
         }
+#ifndef TEST_HAS_NO_EXCEPTIONS
         {
             std::promise<T> p;
             std::future<T> f = p.get_future();
@@ -116,6 +120,7 @@ int main()
             }
             assert(!f.valid());
         }
+#endif
     }
     {
         typedef void T;
@@ -127,6 +132,7 @@ int main()
             f.get();
             assert(!f.valid());
         }
+#ifndef TEST_HAS_NO_EXCEPTIONS
         {
             std::promise<T> p;
             std::future<T> f = p.get_future();
@@ -143,5 +149,6 @@ int main()
             }
             assert(!f.valid());
         }
+#endif
     }
 }

Modified: libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp?rev=283441&r1=283440&r2=283441&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp Thu Oct  6 06:15:41 2016
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 
 // <thread>
@@ -33,7 +32,7 @@ std::atomic<unsigned> outstanding_new(0)
 void* operator new(std::size_t s) throw(std::bad_alloc)
 {
     if (throw_one == 0)
-        throw std::bad_alloc();
+        TEST_THROW(std::bad_alloc());
     --throw_one;
     ++outstanding_new;
     void* ret = std::malloc(s);
@@ -118,6 +117,7 @@ public:
 //  3 Finally check that a thread runs successfully if we throw after 'N+1'
 //    allocations.
 void test_throwing_new_during_thread_creation() {
+#ifndef TEST_HAS_NO_EXCEPTIONS
     throw_one = 0xFFF;
     {
         std::thread t(f);
@@ -142,6 +142,7 @@ void test_throwing_new_during_thread_cre
     }
     f_run = false;
     throw_one = 0xFFF;
+#endif
 }
 
 int main()
@@ -162,6 +163,7 @@ int main()
         assert(G::op_run);
     }
     G::op_run = false;
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
         try
         {
@@ -178,6 +180,7 @@ int main()
             assert(!G::op_run);
         }
     }
+#endif
 #if TEST_STD_VER >= 11
     {
         assert(G::n_alive == 0);




More information about the cfe-commits mailing list