From 2d31e197db370d037393e8e02f4bf836f7acc952 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 12 May 2017 01:44:51 +0000 Subject: [PATCH] Fix or move tests with non-standard assumptions git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302862 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../thread.thread.this/sleep_for.pass.cpp | 1 - .../template.bitset/includes.pass.cpp | 32 +++++++++++++++++ .../tuple/tuple.tuple/empty_member.pass.cpp | 0 .../sleep_for_tested_elsewhere.pass.cpp | 22 ++++++++++++ .../template.bitset/includes.pass.cpp | 35 +++++++++++-------- 5 files changed, 74 insertions(+), 16 deletions(-) rename test/{std => libcxx}/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp (99%) create mode 100644 test/libcxx/utilities/template.bitset/includes.pass.cpp rename test/{std => libcxx}/utilities/tuple/tuple.tuple/empty_member.pass.cpp (100%) create mode 100644 test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp diff --git a/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp similarity index 99% rename from test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp rename to test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp index 891b084dd..b46c2cdec 100644 --- a/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp +++ b/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp @@ -35,7 +35,6 @@ void sig_action(int) {} -#include int main() { int ec; diff --git a/test/libcxx/utilities/template.bitset/includes.pass.cpp b/test/libcxx/utilities/template.bitset/includes.pass.cpp new file mode 100644 index 000000000..2e3c2812e --- /dev/null +++ b/test/libcxx/utilities/template.bitset/includes.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// test that includes , , and + +#include + +#ifndef _LIBCPP_CSTDDEF +#error has not been included +#endif + +#ifndef _LIBCPP_STRING +#error has not been included +#endif + +#ifndef _LIBCPP_STDEXCEPT +#error has not been included +#endif + +#ifndef _LIBCPP_IOSFWD +#error has not been included +#endif + +int main() +{ +} diff --git a/test/std/utilities/tuple/tuple.tuple/empty_member.pass.cpp b/test/libcxx/utilities/tuple/tuple.tuple/empty_member.pass.cpp similarity index 100% rename from test/std/utilities/tuple/tuple.tuple/empty_member.pass.cpp rename to test/libcxx/utilities/tuple/tuple.tuple/empty_member.pass.cpp diff --git a/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp b/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp new file mode 100644 index 000000000..3406fff70 --- /dev/null +++ b/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp @@ -0,0 +1,22 @@ +// -*- 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. +// +//===----------------------------------------------------------------------===// + +// + +// template +// void sleep_for(const chrono::duration& rel_time); + +// The std::this_thread::sleep_for test requires POSIX specific headers and +// is therefore non-standard. For this reason the test lives under the 'libcxx' +// subdirectory. + +int main() +{ +} diff --git a/test/std/utilities/template.bitset/includes.pass.cpp b/test/std/utilities/template.bitset/includes.pass.cpp index 2e3c2812e..e640a1b5b 100644 --- a/test/std/utilities/template.bitset/includes.pass.cpp +++ b/test/std/utilities/template.bitset/includes.pass.cpp @@ -11,22 +11,27 @@ #include -#ifndef _LIBCPP_CSTDDEF -#error has not been included -#endif - -#ifndef _LIBCPP_STRING -#error has not been included -#endif - -#ifndef _LIBCPP_STDEXCEPT -#error has not been included -#endif - -#ifndef _LIBCPP_IOSFWD -#error has not been included -#endif +template void test_typedef() {} int main() { + { // test for + std::ptrdiff_t p; ((void)p); + std::size_t s; ((void)s); + std::nullptr_t np; ((void)np); + } + { // test for + std::string s; ((void)s); + } + { // test for + std::logic_error le("blah"); ((void)le); + std::runtime_error re("blah"); ((void)re); + } + { // test for + test_typedef(); + test_typedef(); + test_typedef(); + test_typedef(); + test_typedef(); + } }