Eric Fiselier
7ba695e32c
Add module definitions for <experimental/foo> headers
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:55:34 +00:00
Eric Fiselier
72a5c771b8
Add module definitions for string_view
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:53:23 +00:00
Eric Fiselier
045b27e848
Add modules for any/optional/variant
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:33:19 +00:00
Eric Fiselier
bca6de0e4e
Adjust libc++ test infastructure to fully support modules
...
This patch overhalls the libc++ test format/configuration in order to fully support modules. By "fully support" I mean get almost all of the tests passing. The main hurdle for doing this is handling tests that `#define _LIBCPP_FOO` macros to test a different configuration. This patch deals with these tests in the following ways:
1. For tests that define single `_LIBCPP_ABI_FOO` macros have been annotated with `// MODULES_DEFINES: _LIBCPP_ABI_FOO`. This allows the test suite to define the macro on the command line so it uses a different set of modules.
2. Tests for libc++'s debug mode (which define custom `_LIBCPP_ASSERT`) are automatically detected by the test suite and are compiled and run with modules disabled.
This patch also cleans up how the `CXXCompiler` helper class handles enabling/disabling language features.
NOTE: This patch uses `LIT` features which were only committed to LLVM today. If this patch breaks running the libc++ tests you probably need to update LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 23:16:07 +00:00
Shoaib Meenai
c6d8e8a9cc
[libc++] Add _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
...
It's useful to be able to disable visibility annotations entirely; for
example, if we're building libc++ static to include in another library,
and we don't want any libc++ functions getting exported out of that
library. This is a generalization of _LIBCPP_DISABLE_DLL_IMPORT_EXPORT.
Differential Revision: https://reviews.llvm.org/D26934
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 19:40:12 +00:00
Roger Ferrer Ibanez
d59e3c7fed
Handle tests for noexcept that expect a false value
...
Under libcpp-no-exceptions, noexcept is trivially true. Some tests expect in
the usual setting to return false, so adjust them to expect true under
libcpp-no-exceptions.
Differential Revision: https://reviews.llvm.org/D27310
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 11:05:09 +00:00
Eric Fiselier
b5c2c47fb6
Update status page for variant implementation
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288625 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-04 22:14:53 +00:00
Eric Fiselier
0c2ffb6670
Choose better hash values for std::monostate and valueless variants.
...
Previously these hashes were 0 and -1 respectively. These seem like common
sentinel values and should be avoided to prevent needless collisions.
This patch changes those values to different arbitrary numbers, which should
hopefully cause less collisions. Because I couldn't help myself I choose the
fundamental constants for gravity and the speed of light.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-04 21:37:37 +00:00
Eric Fiselier
c4599da258
Turn off testsuite warnings by default with GCC
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 03:29:45 +00:00
Eric Fiselier
81b7f63174
Make make_exception_ptr abort with -fno-exceptions
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 03:22:11 +00:00
Eric Fiselier
dd74cd25d5
Mark various <variant> items as complete
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288574 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 02:47:40 +00:00
Eric Fiselier
29616b3806
Work around more -Wshadow warnings
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 02:26:28 +00:00
Eric Fiselier
5b0fa443aa
Fix <variant> w/o exception support
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:58:07 +00:00
Eric Fiselier
b8574af83c
Revert workaround for Clang bug. Thanks to Richard for the quick fix
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288566 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:28:01 +00:00
Eric Fiselier
90ade0a661
Fix -Wshadow warnings and enable warnings by default for C++ >= 11
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288564 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:21:40 +00:00
Eric Fiselier
b0d421ae1e
XFAIL variant tests for apple-clang
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 00:33:03 +00:00
Eric Fiselier
efc48515b4
Enable warnings by default for C++ >= 11 and fix -Wshadow occurances
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 00:27:13 +00:00
Eric Fiselier
ac5c826faf
Work around Clang 3.8 bugs
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 00:13:33 +00:00
Eric Fiselier
a2ff798745
Fix C++03 build
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:41:18 +00:00
Eric Fiselier
120401a4e0
Make variant's index part of the hash value
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:38:31 +00:00
Eric Fiselier
4975ccc637
Fix generated warnings in <variant>
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:17:33 +00:00
Eric Fiselier
f7168e5e0b
Update darwin ABI list for <variant>
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:14:18 +00:00
Eric Fiselier
f722080ff3
Update ABI lists for <variant>
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:11:28 +00:00
Eric Fiselier
cab2af8418
Implement C++17 <variant>. Patch from Michael Park!
...
This patch was reviewed as https://reviews.llvm.org/D23263 .
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 23:00:05 +00:00
Eric Fiselier
4dfe243dac
Work around a bug in Clang's implementation of noexcept function types
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 22:30:52 +00:00
Eric Fiselier
7f2b2c8362
Fix copy/paste errors in new variant tests
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288538 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 21:32:35 +00:00
Eric Fiselier
08d07da127
Add tests for libc++'s constexpr variant copy/move extension
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288536 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 21:17:51 +00:00
Roger Ferrer Ibanez
63f6af49d5
Protect sequences test under libcpp-no-exceptions
...
Replace throw with TEST_THROW and protect tests that do throw. Also add missing assert(false).
Differential Revision: https://reviews.llvm.org/D27252
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:36:41 +00:00
Roger Ferrer Ibanez
5813abeff2
Protect futures test under libcpp-no-exceptions
...
Skip tests that expect an exception be thrown.
Differential Revision: https://reviews.llvm.org/D27253
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:34:57 +00:00
Roger Ferrer Ibanez
486d8a9adc
Protect optional test under libcpp-no-exceptions
...
Replace throw with TEST_THROW and skip tests that throw exceptions
Differential Revision: https://reviews.llvm.org/D27254
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:33:36 +00:00
Roger Ferrer Ibanez
7110e847a6
Protect std::ostream::sentry test under libcpp-no-exceptions
...
Skip test that throws an exception.
Differential Revision: https://reviews.llvm.org/D27255
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288378 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:31:38 +00:00
Roger Ferrer Ibanez
72ac68a980
Protect std::array tests under noexceptions
...
Skip tests that expect exceptions be thrown. Also add missing asserts.
Differential Revision: https://reviews.llvm.org/D27095
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 17:10:29 +00:00
Roger Ferrer Ibanez
81086f8bfe
Protect std::string tests under libcpp-no-exceptions
...
Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.
Differential Revision: https://reviews.llvm.org/D26612
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:40:19 +00:00
Roger Ferrer Ibanez
d6f05863c3
Protect std::{,unordered_}map tests under noexceptions
...
Skip tests that use exceptions
Differential Revision: https://reviews.llvm.org/D27093
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:37:48 +00:00
Roger Ferrer Ibanez
10ffcdf7d0
Protect locale tests under noexceptions
...
Skip tests that expect exceptions be thrown.
Differential Revision: https://reviews.llvm.org/D27096
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:31:40 +00:00
Roger Ferrer Ibanez
ac5aff30fe
Protect test for dynarray under libcpp-no-exceptions
...
This test expects an exception be thrown.
Differential Revision: https://reviews.llvm.org/D26611
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 16:27:45 +00:00
Aditya Kumar
4299795816
[libcxx] remove unused code
...
The macro _LIBCPP_UNROLL_LOOPS isn't used anywhere
so the code was dead.
Differential Revision: https://reviews.llvm.org/D26991
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 14:43:42 +00:00
Marshall Clow
afa9b590b2
Implement conjuntion/disjuntion/negation for LFTS v2. Same code and tests for the ones in std::
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-26 18:45:03 +00:00
Marshall Clow
70e6a8d552
Implement the 'detection idiom' from LFTS v2
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-26 15:49:40 +00:00
Roger Ferrer Ibanez
d3584d51a2
Reverting wrong diff
...
I managed to confuse me with two reviews of the same thing and ended commiting the wrong one.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 11:28:02 +00:00
Roger Ferrer Ibanez
01b9f8a698
Protect tests for std::uninitialized_{copy,fill} under libcpp-no-exceptions
...
Skip tests that expect an exception be thrown.
Differential Revision: https://reviews.llvm.org/D26606
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 11:17:09 +00:00
Roger Ferrer Ibanez
37a0d7cb33
Protect std::string tests under libcpp-no-exceptions
...
Skip tests that expect an exception be thrown and/or disable
unreachable catch handlers.
Differential Revision: https://reviews.llvm.org/D26608
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-24 11:15:09 +00:00
Stephan T. Lavavej
e33c0b01f8
[libcxx] [test] D27027: Strip trailing whitespace.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:03:28 +00:00
Stephan T. Lavavej
39245fe351
[libcxx] [test] D27026: Fix copy-paste silliness; ULL can't ever be 32-bit.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:59 +00:00
Stephan T. Lavavej
50fe47bc8b
[libcxx] [test] D27020: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 7/12.
...
When initializing unsigned integers to their maximum values, change "const T M(~0);" to "const T M(static_cast<T>(-1));".
~0 and -1 are equivalent, but I consider the -1 form to be significantly clearer (and more consistent with other tests).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:53 +00:00
Stephan T. Lavavej
12f7f5d247
[libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 6/12.
...
Add static_cast when initializing unsigned integers with negative numbers (in order to obtain big values).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:44 +00:00
Stephan T. Lavavej
bdf8bae8bb
[libcxx] [test] D27018: Fix MSVC warning C4018 "signed/unsigned mismatch", part 5/12.
...
Various changes:
test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
Change M from unsigned to int. It's compared against "int x",
and we binary_search() for it within a vector<int>.
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval_param.pass.cpp
Add static_cast<unsigned> when comparing int to unsigned.
test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
Change unsigned indices to int when we're being given int as a bound.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:35 +00:00
Stephan T. Lavavej
ed55db243e
[libcxx] [test] D27016: Fix MSVC warning C4018 "signed/unsigned mismatch", part 4/12.
...
Change "int j;" indices to "std::size_t j;".
Also, include <cstddef> when it wasn't already being included.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:27 +00:00
Stephan T. Lavavej
9a65a47871
[libcxx] [test] D27015: Fix MSVC warning C4018 "signed/unsigned mismatch", part 3/12.
...
Change unsigned to int in parameters.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:02:16 +00:00
Stephan T. Lavavej
388c2a8e68
[libcxx] [test] D27014: Fix MSVC warning C4018 "signed/unsigned mismatch", part 2/12.
...
Add static_cast<std::size_t> when comparing int to std::size_t.
Also, include <cstddef> when it wasn't already being included.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 22:01:58 +00:00