From 6fbac40a3018d03f79c22e143b5805e01f20857f Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 18 Jan 2017 01:48:54 +0000 Subject: [PATCH] Add support for running our test suite against MSVC's STL git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292326 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/libcxx/test/config.py | 5 ++++- .../thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp | 4 ++-- test/support/MoveOnly.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/libcxx/test/config.py b/test/libcxx/test/config.py index 6b4afbc79..8ee2d3043 100644 --- a/test/libcxx/test/config.py +++ b/test/libcxx/test/config.py @@ -274,7 +274,7 @@ class Configuration(object): self.cxx_stdlib_under_test = self.get_lit_conf( 'cxx_stdlib_under_test', 'libc++') if self.cxx_stdlib_under_test not in \ - ['libc++', 'libstdc++', 'cxx_default']: + ['libc++', 'libstdc++', 'msvc', 'cxx_default']: self.lit_config.fatal( 'unsupported value for "cxx_stdlib_under_test": %s' % self.cxx_stdlib_under_test) @@ -609,6 +609,9 @@ class Configuration(object): self.config.available_features.add('c++experimental') self.cxx.link_flags += ['-lstdc++fs'] self.cxx.link_flags += ['-lm', '-pthread'] + elif self.cxx_stdlib_under_test == 'msvc': + # FIXME: Correctly setup debug/release flags here. + pass elif self.cxx_stdlib_under_test == 'cxx_default': self.cxx.link_flags += ['-pthread'] else: diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp index 46d04cdac..245c48088 100644 --- a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp @@ -9,10 +9,10 @@ // // UNSUPPORTED: libcpp-has-no-threads -// This test hangs forever when built against libstdc++. In order to allow +// This test hangs forever when built against libstdc++ and MSVC. In order to allow // validation of the test suite against other STLs we have to mark it // unsupported. -// UNSUPPORTED: libstdc++ +// UNSUPPORTED: libstdc++, msvc // diff --git a/test/support/MoveOnly.h b/test/support/MoveOnly.h index a3e9cca89..0ffb4ffe3 100644 --- a/test/support/MoveOnly.h +++ b/test/support/MoveOnly.h @@ -41,8 +41,9 @@ namespace std { template <> struct hash - : public std::unary_function { + typedef MoveOnly argument_type; + typedef size_t result_type; std::size_t operator()(const MoveOnly& x) const {return x.get();} };