Commit Graph

2907 Commits

Author SHA1 Message Date
Mehdi Amini
e807cbcd5b Add deployment knobs to tests (for Apple platforms)
The tests for libc++ specify -target on the command-line to the
compiler, but this is problematic for a few reasons.

Firstly, the -target option isn't supported on Apple platforms. Parts
of the triple get dropped and ignored. Instead, software should be
compiled with a combination of the -arch and -m<name>-version-min
options.

Secondly, the generic "darwin" target references a kernel version
instead of a platform version. Each platform has its own independent
versions (with different versions of libc++.1.dylib), independent of the
version of the Darwin kernel.

This commit adds support to the LIT infrastructure for testing against
Apple platforms using -arch and -platform options.

If the host is not on OS X, or the compiler type is not clang or apple-clang, then this commit has NFC.
If the host is on OS X and --param=target_triple=... is specified, then a warning is emitted to use arch and platform instead. Besides the warning, there's NFC.
If the host is on OS X and *no* target-triple is specified, then use the new deployment target logic. This uses two new lit parameters, --param=arch=<arch> and --param=platform=<platform>. <platform> has the form <name>[<version>].
By default, arch is auto-detected from clang -dumpmachine, and platform is "macosx".
If the platform doesn't have a version:
For "macosx", the version is auto-detected from the host system using sw_vers. This may give a different version than the SDK, since new SDKs can be installed on older hosts.
Otherwise, the version is auto-detected from the SDK version using xcrun --show-sdk-path.
-arch <arch> -m<name>-version-min=<version> is added to the compiler flags.
The target triple is computed as <arch>-apple-<platform>. It is *not* passed to clang, but it is available for XFAIL and UNSUPPORTED (as is with_system_cxx_lib=<target>).
For convenience, apple-darwin and <arch>-apple-darwin are added to the set of available features.
There were a number of tests marked to XFAIL on x86_64-apple-darwin11
and x86_64-apple-darwin12. I updated these to
x86_64-apple-macosx10.7 and x86_64-apple-macosx10.8.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 00:59:54 +00:00
Billy Robert O'Neal III
0b23f9c81d Fixed unintentional assignment-in-assert in new "extending memory management tools" algorithms.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 19:36:30 +00:00
Marshall Clow
abba685fcd Implement LWG2784, and mark 2786, 2795, 2804, 2812, 2826, 2834, 2837 and 2838 as complete - since we do them already
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 17:08:47 +00:00
Eric Fiselier
5cdf67386f fix test coverage capture dirs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 05:28:09 +00:00
Eric Fiselier
76880f55bf Fix DoNotOptimize on MSVC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 00:07:08 +00:00
Eric Fiselier
7c7df6461c Implement LWG 2787 - [file_status.cons] is inconsistent
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 21:02:06 +00:00
Eric Fiselier
a075831614 Remove the buildit and testit scripts; they haven't been supported in years
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 22:47:45 +00:00
Eric Fiselier
c1b1d7f0bb Fix hash requirements check in __hash_table.
r296565 attempted to add better diagnostics when an unordered container
is instantiated with a hash that doesn't meet the Hash requirements.

However I mistakenly checked the wrong set of requirements. Specifically
it checked if the hash met the requirements for specializations of
std::hash. However these requirements are stricter than the generic
Hash requirements.

This patch fixes the assertions to only check the Hash requirements.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 22:35:58 +00:00
Mehdi Amini
c795c2a010 Fix libc++ test to pass in C++03 mode
Was hitting: "error: scalar initializer cannot be empty"

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 17:24:29 +00:00
Eric Fiselier
f4dfb45247 Clean up more usages of _LIBCPP_HAS_NO_RVALUE_REFERENCES
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 03:43:25 +00:00
Eric Fiselier
04732df052 Fix sign-compare warning in test; Oddly this only appears on OS X
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03 02:02:07 +00:00
Eric Fiselier
778ec30428 Work around test failure on 32 bit OS X
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 23:18:40 +00:00
Eric Fiselier
92dbfc48cc remove max_size() extension from polymorphic_allocator. It is unneeded
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 22:10:14 +00:00
Mehdi Amini
3df9fd8924 Fix libc++ test experimental/algorithms/alg.random.sample/sample.pass.cpp when ran in c++11 mode 32 bits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 22:08:42 +00:00
Eric Fiselier
f282bc8767 Fix test failures caused by new/delete calls getting optimized away
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 21:16:35 +00:00
Eric Fiselier
459bbcdd44 Remove more usages of REQUIRES-ANY in the test-suite
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 02:04:49 +00:00
Mehdi Amini
bd89190e69 Recommit r296712: "Fix Apple-specific XFAIL directive in libc++ test"
The test is passing with c++11 and c++14 but not c++1z on this
particular version of the compiler. Try to use lit boolean condition
to satisfy this constaint.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 02:01:11 +00:00
Mehdi Amini
c10e963f3d Revert "Fix Apple-specific XFAIL directive in libc++ test"
This reverts commit r296712. It broke our bot.

It turns out that the test is passing with c++11 and c++14 but
not c++1z on this particular version of the compiler. Since one
job is defaulting to c++1z and the other is testing all config I'm
not sure how to fix this...

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 01:57:40 +00:00
Mehdi Amini
5876a625ba Fix Apple-specific XFAIL directive in libc++ test
This tests is failing in XCode 7.0. But Xcode 7.3 that shipped
an updated clang has this test passing. This is fixing green dragon
which runs this configuration.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 23:45:03 +00:00
Mehdi Amini
d3acadce0c Fix Apple-specific XFAIL directive in libc++ test
These tests are failing in XCode 8.0, 8.1, and 8.2, but not in Xcode
8.3. Annoyingly the version numbering for clang does not follow Xcode
and is bumped to 8.1 only in Xcode 8.3. So Xfailing apple-clang-8.0
should catch all cases here.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296704 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 23:14:34 +00:00
Eric Fiselier
c57fb58f18 Generate the test configuration even when LIBCXX_INCLUDE_TESTS=OFF.
This patch changes the CMake configuration so that it always
generates the test/lit.site.cfg file, even when testing is disabled.

This allows users to test libc++ without requiring them to have
a full LLVM checkout on their machine.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 21:53:30 +00:00
Eric Fiselier
0987c0c391 Mark test as unsupported in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 02:52:04 +00:00
Eric Fiselier
f9ddb9a217 Fix test failures due to bad test hasher
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296568 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 02:34:27 +00:00
Eric Fiselier
c6422362d5 Improve diagnostics when an invalid hash is used in an unordered container.
This patch adds a static assertion that the specified hash meets
the requirements of an enabled hash, and it ensures that the static
assertion is evaluated before __compressed_pair is instantiated.
That way the static assertion diagnostic is emitted first.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 02:02:28 +00:00
Eric Fiselier
67f7a78126 Fix PR32097 - is_abstract doesn't work on class templates.
This patch fixes llvm.org/PR32097 by using the __is_abstract
builtin type-trait instead of the previous library-only implementation.

All supported compilers provide this trait. I've tested as far
back as Clang 3.2, GCC 4.6 and MSVC trunk.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:27:14 +00:00
Michael Park
0268c19d72 Updated the XFAIL comment in variant tests.
Summary:
`ConstexprTestTypes::NoCtors` is an aggregate type (and consequently a literal type) in C++17,
but not in C++14 since it has a base class. This patch updates the comment to accurately describe the reason for the XFAIL.

Reviewers: EricWF

Reviewed By: EricWF

Differential Revision: https://reviews.llvm.org/D30481

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:07:56 +00:00
Steven Wu
244033db8b Remove XFAIL in implicit_deduction_guides tests
The clang assertion causing these tests failing with sanitizer is fixed
in r295794. All the bots running libcxx tests should be upgraded and
running the compiler with the fix.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296385 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 21:10:41 +00:00
Asiri Rathnayake
dec9851c7f Fix cmake dependency for the external-thread-library variant. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 13:19:25 +00:00
Saleem Abdulrasool
7556597a12 test: silence warnings on clang under clang-cl
When running under clang-cl mode, we do not define `__GNUC__`, resulting
in the test failing.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 19:28:41 +00:00
Saleem Abdulrasool
524f109550 test: explicitly size enumeration
On certain targets, enumerations may be smaller than an `unsigned long`.
Use an explicitly sized enumeration.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 19:28:36 +00:00
Eric Fiselier
b7fd0be370 Update all bug URL's to point to https://bugs.llvm.org/...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 08:37:03 +00:00
Eric Fiselier
8c9af4d299 Remove dead code in test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:00:04 +00:00
Eric Fiselier
836ae8fa96 add implicit deduction guide tests for string_view
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 06:59:11 +00:00
Eric Fiselier
224dbbb3d6 Work around Clang assertion when testing C++17 deduction guides with '-g'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 05:04:09 +00:00
Eric Fiselier
6ebcc5c9c4 Add doc for _LIBCPP_ENABLE_CXX17_DISABLED_AUTO_PTR and make it work under _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 03:30:25 +00:00
Eric Fiselier
515ba559b9 [libcxx] Remove unexpected handlers in C++17
Summary:
This patch implements [P0003R5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) which removes exception specifications from C++17.

The only changes to the library are removing `set_unexpected`, `get_unexpected`, `unexpected`, and `unexpected_handler`. These functions can be re-enabled in C++17 using `_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS`.

@mclow.lists what do you think about removing stuff is this way?

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: mclow.lists, cfe-commits

Differential Revision: https://reviews.llvm.org/D28172

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 03:25:08 +00:00
Eric Fiselier
0eaf2e8474 [libc++] Fix PR 31938 - std::basic_string constructors use non-deductible parameter types.
Summary:
This patch fixes http://llvm.org/PR31938. The description below is copy/pasted from the bug:

The standard says:

template<class charT, class traits = char_traits<charT>,
         class Allocator = allocator<charT>>
class basic_string {
  using value_type = typename traits::char_type;
  // ...
  basic_string(const charT* s, const Allocator& a = Allocator());
};

libc++ actually chooses to declare the constructor as

  basic_string(const value_type* s, const Allocator& a = Allocator());

The implicit deduction guides from class template argument deduction make what was previously an implementation detail visible:

std::basic_string s = "foo"; // error, can't deduce charT.

The constructor in question is in the libc++ DSO, but fortunately it looks like fixing this will not result in an ABI break.


@rsmith How does this look? I did more than just the constructors mentioned in the PR, but IDK how far to take it.


Reviewers: mclow.lists, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, rsmith

Differential Revision: https://reviews.llvm.org/D29863

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:17:10 +00:00
Eric Fiselier
4203bfb5d3 add tests for ENAMETOOLONG
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 01:00:37 +00:00
Eric Fiselier
2c477cb41a Add tests for noexcept functions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 22:44:39 +00:00
Saleem Abdulrasool
7f5b63b5c4 test: mark another test as requiring pthreads
This is checking pthread specific behaviour.  Add a requirement on
pthreads.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 15:26:47 +00:00
Saleem Abdulrasool
bd18417b4d test: use char32_t rather than wchar_t
wchar_t is not as portable as char32_t.  On Windows, wchar_t is
16-bytes and on Linux 32-bits.  The conversion to utf8 causes the
characters to exceed the limits on char16_t, resulting in tautological
comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 21:42:35 +00:00
Saleem Abdulrasool
effe3dc412 test: mark requirement for pthread test
This test explicitly is checking the behaviour of std::thread and
pthread interactions.  This requires pthreads.  Add an appropriate
requirement.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:48 +00:00
Saleem Abdulrasool
0849d28af1 test: squelch -Wreturn-type error
Add an unreachable marker to avoid a -Wreturn-type error when building
on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-12 17:37:44 +00:00
Marshall Clow
197b8821c6 Fix a bug I introduced in the tests for experimental::lcm and experimental::gcd.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 22:44:14 +00:00
Marshall Clow
ebf66a385f Make lcm/gcd work better in edge cases. Fixes a UBSAN failure.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 20:49:08 +00:00
Saleem Abdulrasool
4aac249f71 test: XFAIL windows for non-portable test
This test validates that the lock_guard is declared variadically across
C++03 and C++11.  Given the lack of stable ABI on Windows and the fact
that the RTTI encoding on Windows is different, XFAIL it on that target.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:51:21 +00:00
Saleem Abdulrasool
74ec9d7947 test: fix test under Windows
When running the test under clang-cl, we do not report `__GNUC__`, which
is needed to supress the warnings which are being treated as errors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294719 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 06:51:19 +00:00
Eric Fiselier
ed803866ea Move libcxx/test/libcxx python package into libcxx/utils/libcxx.
This patch merges the test python package with the newly
created package in utils.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 23:18:11 +00:00
Eric Fiselier
1147753b1c Start libc++ python cleanup and consolidation.
Libc++ frequently creates and uses utilities written in python.
Currently there are python modules under both libcxx/test and
libcxx/util. My goal with these changes is to consolidate them
into a single package under libcxx/utils/libcxx.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294644 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 22:53:14 +00:00
Eric Fiselier
d8b62dceb2 Fix PR31916 - std::visit rejects visitors accepting lvalue arguments
A static assertion was misfiring since it checked
is_callable<Visitor, decltype(__variant_alt<T>.value)>. However
the decltype expression doesn't capture the value category as
required. This patch applies extra braces to decltype to fix
that.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 19:01:22 +00:00