summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2019-03-26 19:50:46 +0000
committerBrian Gesiak <modocache@gmail.com>2019-03-26 19:50:46 +0000
commitb66754a29ed7a479e36fed89e0b45d10d5e71e71 (patch)
tree759fd580d95d431848d0c5f8176c77b7c5e6705d /libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp
parent492f752969ff3a37138372e8e973317dc63ef2d3 (diff)
downloadbcm5719-llvm-b66754a29ed7a479e36fed89e0b45d10d5e71e71.tar.gz
bcm5719-llvm-b66754a29ed7a479e36fed89e0b45d10d5e71e71.zip
Revert "[coroutines] Add std::experimental::task<T> type"
This revision is causing build and test failures, such as http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv8-linux/builds/648/steps/test.libcxx/logs/stdio, so I'll revert it. llvm-svn: 357023
Diffstat (limited to 'libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp')
-rw-r--r--libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp70
1 files changed, 0 insertions, 70 deletions
diff --git a/libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp b/libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp
deleted file mode 100644
index 0d5a8c9f619..00000000000
--- a/libcxx/test/std/experimental/task/task.basic/task_of_value.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <experimental/task>
-#include <string>
-#include <vector>
-#include <memory>
-#include "../sync_wait.hpp"
-
-void test_returning_move_only_type()
-{
- auto move_only_async =
- [](bool x) -> std::experimental::task<std::unique_ptr<int>> {
- if (x) {
- auto p = std::make_unique<int>(123);
- co_return p; // Should be implicit std::move(p) here.
- }
-
- co_return std::make_unique<int>(456);
- };
-
- assert(*sync_wait(move_only_async(true)) == 123);
- assert(*sync_wait(move_only_async(false)) == 456);
-}
-
-void test_co_return_with_curly_braces()
-{
- auto t = []() -> std::experimental::task<std::tuple<int, std::string>>
- {
- co_return { 123, "test" };
- }();
-
- auto result = sync_wait(std::move(t));
-
- assert(std::get<0>(result) == 123);
- assert(std::get<1>(result) == "test");
-}
-
-void test_co_return_by_initialiser_list()
-{
- auto t = []() -> std::experimental::task<std::vector<int>>
- {
- co_return { 2, 10, -1 };
- }();
-
- auto result = sync_wait(std::move(t));
-
- assert(result.size() == 3);
- assert(result[0] == 2);
- assert(result[1] == 10);
- assert(result[2] == -1);
-}
-
-int main()
-{
- test_returning_move_only_type();
- test_co_return_with_curly_braces();
- test_co_return_by_initialiser_list();
-
- return 0;
-}
OpenPOWER on IntegriCloud