diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-08-19 04:10:15 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-08-19 04:10:15 +0000 |
commit | 1df02ee1f989139c4fcfb47009ce4d62e2ca5146 (patch) | |
tree | 8a8c54849765cebc8a5872e9b822c4232e9f7bb7 /libcxx/test/std/thread | |
parent | 464be90e6d0dd98b1e8f1cc55e05b260fa81d20b (diff) | |
download | bcm5719-llvm-1df02ee1f989139c4fcfb47009ce4d62e2ca5146.tar.gz bcm5719-llvm-1df02ee1f989139c4fcfb47009ce4d62e2ca5146.zip |
Mark std::packaged_task tests as unsupported in C++03.
std::packaged_task requires variadic templates and is #ifdef out in C++03.
This patch silences the tests in C++03. This patch also rewrites the .fail.cpp tests so that they use clang verify.
llvm-svn: 245413
Diffstat (limited to 'libcxx/test/std/thread')
18 files changed, 45 insertions, 61 deletions
diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp index 70ea0ad31fe..6c6418594d0 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <future> // class packaged_task<R(ArgTypes...)> @@ -14,35 +16,11 @@ // packaged_task& operator=(packaged_task&) = delete; #include <future> -#include <cassert> - -class A -{ - long data_; - -public: - explicit A(long i) : data_(i) {} - - long operator()(long i, long j) const {return data_ + i + j;} -}; int main() { { - std::packaged_task<double(int, char)> p0(A(5)); - std::packaged_task<double(int, char)> p; - p = p0; - assert(!p0.valid()); - assert(p.valid()); - std::future<double> f = p.get_future(); - p(3, 'a'); - assert(f.get() == 105.0); - } - { - std::packaged_task<double(int, char)> p0; - std::packaged_task<double(int, char)> p; - p = p0; - assert(!p0.valid()); - assert(!p.valid()); + std::packaged_task<double(int, char)> p0, p; + p = p0; // expected-error {{overload resolution selected deleted operator '='}} } } diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp index 18786f4eb7a..3f11d670bed 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp index 45048b747f7..7097d428962 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <future> // class packaged_task<R(ArgTypes...)> @@ -25,5 +27,6 @@ typedef volatile std::packaged_task<A(int, char)> VPT; int main() { - PT p { VPT{} }; + PT p { VPT{} }; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}} + // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}} } diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp index e4df4ec225e..feb7657bed3 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <future> // class packaged_task<R(ArgTypes...)> @@ -18,7 +20,7 @@ #include <future> #include <cassert> -#include "../../test_allocator.h" +#include "test_allocator.h" struct A {}; typedef std::packaged_task<A(int, char)> PT; @@ -26,5 +28,6 @@ typedef volatile std::packaged_task<A(int, char)> VPT; int main() { - PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}}; + PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}} + // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}} } diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp index 9884c49a6dc..97624f90f3d 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <future> // class packaged_task<R(ArgTypes...)> @@ -14,33 +16,12 @@ // packaged_task(packaged_task&) = delete; #include <future> -#include <cassert> - -class A -{ - long data_; -public: - explicit A(long i) : data_(i) {} - - long operator()(long i, long j) const {return data_ + i + j;} -}; int main() { { - std::packaged_task<double(int, char)> p0(A(5)); - std::packaged_task<double(int, char)> p(p0); - assert(!p0.valid()); - assert(p.valid()); - std::future<double> f = p.get_future(); - p(3, 'a'); - assert(f.get() == 105.0); - } - { std::packaged_task<double(int, char)> p0; - std::packaged_task<double(int, char)> p(p0); - assert(!p0.valid()); - assert(!p.valid()); + std::packaged_task<double(int, char)> p(p0); // expected-error {{call to deleted constructor of 'std::packaged_task<double (int, char)>'}} } } diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp index 76904962a77..ed147d74895 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp index 2eee2cbc2d5..14ac7614bb8 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp index 3aac2b26bfc..39784876b8c 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> @@ -19,7 +20,7 @@ #include <future> #include <cassert> -#include "../../test_allocator.h" +#include "test_allocator.h" #include "min_allocator.h" class A @@ -47,7 +48,7 @@ int main() { std::packaged_task<double(int, char)> p(std::allocator_arg, test_allocator<A>(), A(5)); - assert(test_alloc_base::count > 0); + assert(test_alloc_base::alloc_count > 0); assert(p.valid()); std::future<double> f = p.get_future(); p(3, 'a'); @@ -55,14 +56,14 @@ int main() assert(A::n_copies == 0); assert(A::n_moves > 0); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); A::n_copies = 0; A::n_moves = 0; { A a(5); std::packaged_task<double(int, char)> p(std::allocator_arg, test_allocator<A>(), a); - assert(test_alloc_base::count > 0); + assert(test_alloc_base::alloc_count > 0); assert(p.valid()); std::future<double> f = p.get_future(); p(3, 'a'); @@ -70,31 +71,31 @@ int main() assert(A::n_copies > 0); assert(A::n_moves > 0); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); A::n_copies = 0; A::n_moves = 0; { A a(5); std::packaged_task<int(int)> p(std::allocator_arg, test_allocator<A>(), &func); - assert(test_alloc_base::count > 0); + assert(test_alloc_base::alloc_count > 0); assert(p.valid()); std::future<int> f = p.get_future(); p(4); assert(f.get() == 4); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); A::n_copies = 0; A::n_moves = 0; { A a(5); std::packaged_task<int(int)> p(std::allocator_arg, test_allocator<A>(), func); - assert(test_alloc_base::count > 0); + assert(test_alloc_base::alloc_count > 0); assert(p.valid()); std::future<int> f = p.get_future(); p(4); assert(f.get() == 4); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); A::n_copies = 0; A::n_moves = 0; { diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp index 88f07228175..d9951dca585 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp index e24232d1b22..afaf0a55f91 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp index 13b5db11066..d0e060d8c71 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp index 61a6a4f8796..57879559ac2 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp index 2a09353b1e6..4a6d3c75917 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp index 9d38d9b409c..924188b27aa 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp index 33763bef0d0..eb0091c8e81 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp index 668732b9b24..d90d593a75b 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp index 986f71e29a4..bbe75de7f8a 100644 --- a/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp @@ -9,6 +9,12 @@ // // UNSUPPORTED: libcpp-has-no-threads +// This test is marked XFAIL and not UNSUPPORTED because the non-variadic +// declaration of packaged_task is available in C++03. Therefore the test +// should fail because the static_assert fires and not because std::packaged_task +// in undefined. +// XFAIL: c++98, c++03 + // <future> // class packaged_task<R(ArgTypes...)> @@ -18,7 +24,7 @@ // : true_type { }; #include <future> -#include "../../test_allocator.h" +#include "test_allocator.h" int main() { diff --git a/libcxx/test/std/thread/futures/futures.tas/types.pass.cpp b/libcxx/test/std/thread/futures/futures.tas/types.pass.cpp index dd1724ddbda..f7c9b223add 100644 --- a/libcxx/test/std/thread/futures/futures.tas/types.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.tas/types.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> |