Transform the libc++ coroutine shell tests into normal .pass.cpp tests.

The shell test versions didn't get all of the flags normal tests
do, specifically warning flags. This patch makes them .pass.cpp tests,
and uses a lit.local.cfg to add -fcoroutines-ts and to make them
UNSUPPORTED when that flag isn't available.

llvm-svn: 304351
This commit is contained in:
Eric Fiselier 2017-05-31 21:34:43 +00:00
parent 0bd3f41588
commit 4f429cecd9
25 changed files with 15 additions and 107 deletions

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <type_traits>
@ -70,4 +66,8 @@ int main()
static_assert(std::is_trivially_copyable<S>::value, "");
static_assert(check_suspend_constexpr(), "");
}
{
// suppress unused warnings for the global constexpr test variable
((void)constexpr_sa);
}
}

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <type_traits>
@ -72,4 +68,8 @@ int main()
static_assert(std::is_trivially_copyable<S>::value, "");
static_assert(check_suspend_constexpr(), "");
}
{
// suppress unused warnings for the global constexpr test variable
((void)constexpr_sn);
}
}

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <cassert>
@ -58,6 +54,7 @@ coro_t f(int n) {
co_return;
}
int val = co_await A{};
((void)val);
set_value(42);
}

View File

@ -9,14 +9,10 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// FIXME: When run under UBSAN this test hits an assertion inside Clang
// XFAIL: ubsan
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <cassert>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <cassert>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <cassert>
@ -67,6 +63,7 @@ coro2 a() {
assert(alive == 1);
assert(ctor_called == 1);
assert(dtor_called == 0);
((void)x);
}
assert(alive == 0);
assert(dtor_called == 1);
@ -75,7 +72,8 @@ coro2 a() {
coro2 b() {
reset();
{
co_await Bug{};
auto x = co_await Bug{};
((void)x);
assert(ctor_called == 1);
assert(dtor_called == 1);
assert(alive == 0);
@ -102,7 +100,8 @@ coro2 c() {
coro2 d() {
reset();
{
co_yield 42;
auto x = co_yield 42;
((void)x);
assert(ctor_called == 1);
assert(dtor_called == 1);
assert(alive == 0);

View File

@ -9,14 +9,10 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// FIXME: When run under UBSAN this test hits an assertion inside Clang
// XFAIL: ubsan
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <vector>
#include <cassert>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <cassert>
@ -166,9 +162,7 @@ goroutine pusher(channel& left, channel& right)
}
}
const int N = 100; //100'000'000;
const int repeat = 1;
const int N = 100;
channel* c = new channel[N + 1];
int main() {

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <cassert>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
#include <experimental/coroutine>
#include <vector>

View File

@ -9,10 +9,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// REQUIRES: fcoroutines-ts
// RUN: %build -fcoroutines-ts
// RUN: %run
// <experimental/coroutine>
@ -20,8 +16,6 @@
#include <experimental/coroutine>
int main(){
// std::nothrow is not implicitly defined by the compiler when the include is
// missing, unlike other parts of <new>. Therefore we use std::nothrow to