diff options
| author | Brian Gesiak <modocache@gmail.com> | 2019-03-26 19:50:46 +0000 |
|---|---|---|
| committer | Brian Gesiak <modocache@gmail.com> | 2019-03-26 19:50:46 +0000 |
| commit | b66754a29ed7a479e36fed89e0b45d10d5e71e71 (patch) | |
| tree | 759fd580d95d431848d0c5f8176c77b7c5e6705d /libcxx/test/std/experimental/task/task.lifetime/task_parameter_lifetime.pass.cpp | |
| parent | 492f752969ff3a37138372e8e973317dc63ef2d3 (diff) | |
| download | bcm5719-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.lifetime/task_parameter_lifetime.pass.cpp')
| -rw-r--r-- | libcxx/test/std/experimental/task/task.lifetime/task_parameter_lifetime.pass.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/libcxx/test/std/experimental/task/task.lifetime/task_parameter_lifetime.pass.cpp b/libcxx/test/std/experimental/task/task.lifetime/task_parameter_lifetime.pass.cpp deleted file mode 100644 index bc1bd432244..00000000000 --- a/libcxx/test/std/experimental/task/task.lifetime/task_parameter_lifetime.pass.cpp +++ /dev/null @@ -1,57 +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 <cassert> - -#include "../counted.hpp" -#include "../sync_wait.hpp" - -DEFINE_COUNTED_VARIABLES(); - -void test_parameter_lifetime() -{ - counted::reset(); - - auto f = [](counted c) -> std::experimental::task<std::size_t> - { - co_return c.id(); - }; - - { - auto t = f({}); - - assert(counted::active_instance_count() == 1); - assert(counted::copy_constructor_count() == 0); - assert(counted::move_constructor_count() <= 2); // Ideally <= 1 - - auto id = sync_wait(t); - assert(id == 1); - - assert(counted::active_instance_count() == 1); - assert(counted::copy_constructor_count() == 0); - - // We are relying on C++17 copy-elision when passing the temporary counter - // into f(). Then f() must move the parameter into the coroutine frame by - // calling the move-constructor. This move could also potentially be - // elided by the - assert(counted::move_constructor_count() <= 1); - } - - assert(counted::active_instance_count() == 0); -} - -int main() -{ - test_parameter_lifetime(); - return 0; -} |

