Commit Graph

877 Commits

Author SHA1 Message Date
Marshall Clow
f2e36ef093 Move the test for zero-length into the char_traits (from string_view). Add tests to char_traits specializations
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228981 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 23:34:52 +00:00
Marshall Clow
451ae6e21c Remove undefined behavior from test; specifically, compare(NULL, XXX, 0)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228928 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:25:54 +00:00
Marshall Clow
bdb73f1f8b Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). Thanks to Eric for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 15:21:20 +00:00
Marshall Clow
e7d392585e Need to wrap a bit in an ifdef, since there are no initializer_lists in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228840 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 15:48:21 +00:00
Marshall Clow
3024f86865 Fix PR 22541: When values are equal, minmax should return the rightmost one in the initializer_list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228839 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 15:41:34 +00:00
Eric Fiselier
a11e2cf183 Update double_include.sh.cpp for new headers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:31:02 +00:00
Eric Fiselier
578c9e8f46 libc++ tests: wait_until.pass test sporadically fails (bug 21998)
Summary:
Hello Howard,

While running the libc++ tests on our ARM boards, we encounter sporadic failures of the two tests:
test/std/thread/futures/futures.shared_future/wait_until.pass.cpp
test/std/thread/futures/futures.unique_future/wait_until.pass.cpp

The worker thread might not finish yet when the main thread checks its result.
I filed the bug 21998 for this case: http://llvm.org/bugs/show_bug.cgi?id=21998

Would you be able to review this please?
Thank you.
Oleg

Reviewers: howard.hinnant, mclow.lists, danalbert, jroelofs, EricWF

Reviewed By: jroelofs, EricWF

Subscribers: EricWF, mclow.lists, aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D6750

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228783 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:25:57 +00:00
Eric Fiselier
566739170a Make convert_to_integral.pass.cpp more platform generic.
Don't depend on the underlying types of enums and wchar_t.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228781 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:18:05 +00:00
Eric Fiselier
1a633ca404 Remove default definition for libcxx_obj_dir because it doesn't make sense
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-11 01:03:44 +00:00
Eric Fiselier
47b9a9a286 Add pragma system header to some experimental headers and add newlines to files.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 17:32:49 +00:00
Eric Fiselier
5495e2efb9 Fix more issues exposed by -pedantic-errors in c++03 mode
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 17:20:18 +00:00
Eric Fiselier
7f9cc52faf Remove use of zero length arrays in tests. Get tests passing with -pedantic-errors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228706 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 16:51:29 +00:00
Eric Fiselier
c3231d213a [libcxx] Fix PR 22468 - std::function<void()> does not accept non-void-returning functions
Summary:
The bug can be found here: http://llvm.org/bugs/show_bug.cgi?id=22468

`__invoke_void_return_wrapper` is needed to properly handle calling a function that returns a value but where the std::function return type is void. Without this '-Wsystem-headers' will cause `function::operator()(...)` to not compile. 

Reviewers: eugenis, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7444

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 16:48:45 +00:00
Eric Fiselier
31cb7fe75e [libcxx] Properly convert the count arguments to the *_n algorithms before use.
Summary:
The requirement on the `Size` type passed to *_n algorithms is that it is convertible to an integral type. This means we can't use a variable of type `Size` directly. Instead we need to convert it to an integral type first.  The problem is finding out what integral type to convert it to.  `__convert_to_integral` figures out what integral type to convert it to and performs the conversion, It also promotes the resulting integral type so that it is at least as big as an integer. `__convert_to_integral` also has a special case for converting enums. This should only work on non-scoped enumerations because it does not apply an explicit conversion from the enum to its underlying type.



Reviewers: chandlerc, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7449

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 16:46:42 +00:00
Eric Fiselier
f17cecb13f Fix use of C++11 extensions in C++03 code.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 15:17:46 +00:00
Eric Fiselier
8492cd84ff Remove use of _[A-Z] identifiers and poison them to detect usage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 23:01:40 +00:00
Eric Fiselier
75fdf0ea7c Get tests running with warnings. Fix warnings in headers and tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228344 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 20:28:37 +00:00
Dimitry Andric
e64ec52760 Test commit: remove whitespace at EOL.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 07:26:14 +00:00
Eric Fiselier
08fe42c473 add platform to LIT's available features
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 23:49:58 +00:00
Eric Fiselier
f6ed0311fb Fix alignment in tests for readability.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228028 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:00:15 +00:00
Greg Fitzgerald
015fb24be6 Don't assume LIT_EXECUTABLE points to a Python script, take 2
Before this patch, the CMake build assumed LIT_EXECUTABLE pointed
to a Python script, not an executable.  If you were to pass in an
executable, such as the result of py2exe on lit.py, the build would
fall over.

With this patch, the CMake build assumes LIT_EXECUTABLE is an
executable.  You can continue setting it to lit.py, but it will
now use its shebang to find a Python interpreter.

Differential Revision: http://reviews.llvm.org/D7315

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@228005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:47:37 +00:00
Greg Fitzgerald
4668566a60 Revert "Don't assume LIT_EXECUTABLE points to a Python script"
This reverts r227994

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:16:47 +00:00
Greg Fitzgerald
35f1c499e4 Don't assume LIT_EXECUTABLE points to a Python script
Before this patch, the CMake build assumed LIT_EXECUTABLE pointed
to a Python script, not an executable.  If you were to pass in an
executable, such as the result of py2exe on lit.py, the build would
fall over.

With this patch, the CMake build assumes LIT_EXECUTABLE is an
executable.  You can continue setting it to lit.py, but it will
now use its shebang to find a Python interpreter.

Differential Revision: http://reviews.llvm.org/D7315

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:02:04 +00:00
Eric Fiselier
cdc7bb55df [libcxx] Add <experimental/system_error>
Summary:
This patch just adds the variable templates in <experimental/system_error>.

see: https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#syserror


Reviewers: jroelofs, danalbert, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: chandlerc, cfe-commits

Differential Revision: http://reviews.llvm.org/D7353

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227973 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 16:03:24 +00:00
Eric Fiselier
665613f5be [libcxx] Add <experimental/chrono>
Summary:
This patch adds <experimental/chrono> which only contains a single variable template.

See: https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#time

Reviewers: jroelofs, danalbert, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7352

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227860 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 21:05:47 +00:00
Marshall Clow
a0ec4b7c85 Fix PR#22433. The algorithm is_partitioned was testing an item in the middle of the sequence twice.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:16:35 +00:00
Marshall Clow
4c2684ccf9 Fix PR#22427. The implementation of inplace_merge had a \'small data set\' optimization; if either half of the merge was small (i.e, less than 9 items), it did an inplace merge rather than allocating a buffer and doing a faster/smarter merge. However, this failed to satisfy the complexity requirements in the standard. Remove that code. Add tests to check the complexity, and add the same tests for std::merge, since we are in that section of the test suite anyway.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227811 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:35:53 +00:00
Marshall Clow
5e56c30413 Fix for PR22061 by K-ballo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227384 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 22:22:35 +00:00
Marshall Clow
df00d5e5ad We had two identical files named 'MoveOnly.h' in the test suite. Move one to support/, remove the other, and update all the tests that included them. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227370 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 21:22:53 +00:00
Marshall Clow
eea9d20edb Removed some tabs that snuck into the test suite. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227363 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 20:26:11 +00:00
Marshall Clow
01c1c6fcc7 Fix PR22366. When move-constructing an associative container and explicitly passing an allocator that compares different, we were not calling the destructor of the elements in the moved-from container.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227359 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 19:54:25 +00:00
Eric Fiselier
a769d7ff49 Fix flag order of -xc++ in CXXCompiler.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-28 00:05:48 +00:00
Eric Fiselier
db5d6af29b Fix definition of __has_feature in r227263
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 23:05:41 +00:00
Eric Fiselier
a4449da43c Ensure __has_feature is defined in test/support/count_new.hpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 23:03:38 +00:00
Eric Fiselier
e1a6c17251 Fix linking pthread in tests on FreeBSD
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 20:43:53 +00:00
Nico Weber
a7dcd3a3e1 [libcxx] Make __wrap_iter work with gcc.
he following snippet doesn't build when using gcc and libc++:

    #include <string>
    void f(const std::string& s) { s.begin(); }
    #include <vector>
    void AppendTo(const std::vector<char>& v) { v.begin(); }

The problem is that __wrap_iter has a private constructor. It lists vector<>
and basic_string<> as friends, but gcc seems to ignore this for vector<> for
some reason. Declaring vector before the friend declaration in __wrap_iter is
enough to work around this problem, so do that. With this patch, I'm able to
build chromium/android with libc++. Without it, two translation units fail to
build. (iosfwd already provides a forward declaration of basic_string.)

As far as I can tell, this is due to a gcc bug, which I filed as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64816.

Fixes PR22355.

http://reviews.llvm.org/D7201


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 19:27:39 +00:00
Marshall Clow
a1bca66d28 Added test for incomplete type support in vector/list/forward_list. References PR#17980
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-26 20:06:52 +00:00
Eric Fiselier
bfad86e967 Change the available features used for no-rtti and no-exceptions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227107 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-26 18:11:58 +00:00
Marshall Clow
b9bf4a2185 Fix PR21428. Buffer was one byte too small in octal formatting case. Add test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@227097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-26 17:24:52 +00:00
Filipe Cabecinhas
447c76d9ee Add USES_TERMINAL to libcxx lit tests, if available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226900 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-23 06:59:51 +00:00
Marshall Clow
3150c3547a Fix PR#22284. Add a new overload to deque::insert to handle forward iterators. Update tests to exercise this case.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226847 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22 18:33:29 +00:00
Eric Fiselier
dd7a4836e3 [libcxx] Allow use of ShTest in libc++ tests along with other changes.
Summary:
This patch allows the use of LIT's ShTest format in the libc++ test suite. ShTests have the suffix '.sh.cpp'. It also introduces a series of other changes. These changes are:

- More functionality including parsing test metadata has been moved into LIT.
- LibcxxTestFormat now supports multi-part suffixes.
- the `CXXCompiler` functionality has been used to shrink the size of LibcxxTestFormat. 
- The recursive loading of the site config has been turned into `libcxx.test.config.loadSiteConfig` so it can be used with libc++abi.
- Temporary files are now created in the build directory of libc++. This follows how it is down in ShTest.
- `not.py` was added as a utility executable that mirrors the functionality of LLVM's `not` executable. 
- The first ShTest test was added under test/libcxx/double_include.sh.cpp


Reviewers: jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7073

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226844 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22 18:05:58 +00:00
Jonathan Roelofs
0243015f64 Fix lit config typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22 00:05:11 +00:00
Eric Fiselier
b3289a0c88 Only use -target flag when target_triple is manually specified
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20 22:37:25 +00:00
Eric Fiselier
e93e0347a6 Print compiler path during configuration and pass more flags to the linker
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226576 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20 16:26:48 +00:00
Eric Fiselier
9ef5d45b2c Address danalbert's post-commit review comments on D7019 and small fixes.
This patch addresses some comments on http://reviews.llvm.org/D7019.

- Move compiler.py to test/libcxx from test/libcxx/test.
- Make CXXCompiler.target None by default.
- Use `{}` instead of `dict()` to initialize an empty dict.
- Pass the -fsanitize options to both the compile and link commands.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20 16:14:18 +00:00
Marshall Clow
02f6369a6b Cleaning up the test suite; remove some includes of non-standard file <__config>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226411 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-18 19:05:51 +00:00
Eric Fiselier
33f50fb940 A couple small changes to get LIT working with python3
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 21:59:07 +00:00
Eric Fiselier
28a058bd51 [libcxx] Add compiler utility class for LIT tests
Summary:
This adds a compiler utility class that handles generating compile commands and running them. Instead of having to pass the compiler path and 3 groups of flags between the configuration and the test format this allows us to just pass the compiler object.



Reviewers: danalbert, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7019

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226323 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 21:35:08 +00:00
Eric Fiselier
ae8bc6b3ef Add 'no_default_flags' option for turning off all default test compile and link flags.
When 'no_default_flags' is true only flags passed using '--param=compile_flags'
and '--param=link_flags' will be used when compiling the tests. This option
can be used to run the test suite against libstdc++ and helps with all
unusual test suite configurations.

NOTE: sanitizer flags are still added when '--param=use_sanitizer' is used even
if '--param=no_default_flags' is given.




git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 21:22:08 +00:00