Commit Graph

1774 Commits

Author SHA1 Message Date
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
Duncan P. N. Exon Smith
07b133f2a7 tuple: Make operator<() linear instead of exponential
Patch by Matthew Dempsky!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21 02:51:17 +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
Dan Albert
cbc84977aa Remove triple detection from cmake.
This isn't actually used for anything, and is broken on Darwin
(currently causing build failures now that the triple is passed to aid
cross compiling). Rather than fix unused code, just remove it.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226243 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 02:27:17 +00:00
Dan Albert
818911cc85 [libc++] Add support for cross compiling.
Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226237 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 00:55:15 +00:00
Jonathan Roelofs
66ffe01f97 Print out environment in lit notes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 23:04:37 +00:00
Dan Albert
7df8e62258 Use set() instead of option() for string option.
Fixes issue in r226185.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 18:56:45 +00:00
Dan Albert
00a620eb3b Add a cmake option for LIT configuration variant.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 18:35:04 +00:00
Jonathan Roelofs
88b2a86232 Refactor configure_link_flags for modularity. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 16:18:13 +00:00
Jonathan Roelofs
583f2e7093 Rename src_root -> libcxx_src_root. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226063 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 00:03:14 +00:00
Jonathan Roelofs
33459617e7 Rename system_lib -> system_cxx_lib. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226061 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 23:38:12 +00:00
Jonathan Roelofs
fcd02b85a5 Rename library_root to libcxx_library_root. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226043 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 21:56:50 +00:00
Jonathan Roelofs
fa08adae13 Refactor configure_compile_flags. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 21:02:14 +00:00
Jonathan Roelofs
7819fd7108 Support picking the unwinder used for testing on linux (just as libc++abi testing allows)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@226024 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 19:29:04 +00:00
Jonathan Roelofs
6f599cea0e Fix a lit configuration diagnostic. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 14:48:27 +00:00
Jonathan Roelofs
f1b1b7f8fe Refactor the lit config's linker flag discovery code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225920 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 01:29:04 +00:00
Marshall Clow
083e011d6c Make regex::assign not clobber the regex in case of failure. Fixes PR#22213
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 16:49:52 +00:00
Eric Fiselier
fe079256b2 Fix vexing parse in test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12 15:56:41 +00:00
Marshall Clow
141dd0c245 One more #include request in the test suite from Walter Brown
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225609 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-11 18:07:06 +00:00
Marshall Clow
e42202138c Change a couple more template parameter names from 'T' to '_Tp', etc. Thanks to Ondřej Majerech for the patch, but I did a bit more.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-11 06:15:59 +00:00
Jonathan Roelofs
13e2966c91 Support Newlib as libc++'s C library [cstdio part, part 2]
Wrappers for clearerr, feof, ferror (which newlib implements as macros).

http://reviews.llvm.org/D5420


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225563 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-10 00:08:00 +00:00
Marshall Clow
6b913d7c52 Walter Brown sent a list of tests which needed 'additional includes' to match what was in the standard. Added these includes to the tests. No changes to the library or test results.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225541 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-09 20:25:52 +00:00
Dan Albert
aa66357f48 [libc++] Refactor test components into modules.
Summary:
I've moved the bulk of `lit.cfg` into `test/libcxx/testconfig.py` and
`test/libcxx/testformat.py`. All that remains in `lit.cfg` is the
logic to discover lit.site.cfg if lit.cfg was run directly, and the
logic for loading configuration variants.

The configuration variant flow has changed with this patch. Rather
than instantiating an object of type `<VARIANT>Configuration`, we now
instatiate an object of type `Configuration` that was loaded from the
module `<VARIANT>.testconfig.py`.

This has to be done on a per-project basis rather than in LIT itself
because LIT doesn't actually know where the real test directory is,
only where the site configuration is (which is usually in the output
directory). It's simple enough to do though, so it's fine to require
each project to do it themselves.

I also cleaned up all the pylint issues while I was here, which was
mostly just a matter of fixing long lines.

Reviewers: mclow.lists, jroelofs, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-09 18:03:29 +00:00
Marshall Clow
6027993c28 K-Ballo found a place where we were using 'V' as a template parameter. Replace with '_Vp' for protection against user-defined macros.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-09 17:03:36 +00:00
Marshall Clow
a09f3444e6 In early C++11 standard drafts, std::function derived from std::unary_function or std::binary_function if there was only one (or two) parameters. Before C++11 shipped, this restiction was lifted, but libc++ still does this (which is fine). However, the tests still check for this outdated requiremnt. Change then to check for the nested typedefs instead (which are still required by the standard). No change to the library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225430 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-08 06:36:41 +00:00
Marshall Clow
1fdd937c0a Add checks to make sure the hash functor has the right typedefs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-08 06:18:59 +00:00
Marshall Clow
c7e395f338 Missed a typename
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225408 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 22:26:48 +00:00
Marshall Clow
674e07d3c8 libc++ implements its' hash objects as deriving from std::unary_function, and the tests test for that. STL @ MS pointed out that the standard doesn't requie these objects to derive from unary_function, and so the tests should not require that either. Change the tests to check for the embedded typedefs - which ARE required. No change to the library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225403 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 21:53:23 +00:00
Marshall Clow
87d03942c4 In C++03, a bunch of the arithmetic/logical/comparison functors (such as negate/bit_not.pass/logical_not) were defined as deriving from unary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225402 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 21:51:30 +00:00
Marshall Clow
b15298338c Add tests to check the typedefs from the result of std::owner_less
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225381 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 20:54:51 +00:00
Marshall Clow
58d4e04168 Missed one comparison test in r225375
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225376 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 20:40:28 +00:00
Marshall Clow
27a1a2c84a In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07 20:31:06 +00:00
Dan Albert
0588c74a87 Move a test to the new tests directory.
I had written the patch that added this test before the tests were
moved into tests/std, so the test ended up in the wrong directory.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 22:18:27 +00:00
Dan Albert
21b03d7189 Make a test UNSUPPORTED if libcpp-has-no-threads.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 19:32:30 +00:00
Dan Albert
8f1ac0fb3d Appease MSAN buildbots.
This is just a compile time test, but we have MSAN buildbots that will
fail since `exp` was uninitialized.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 19:23:25 +00:00
Marshall Clow
fd8ed7fa85 Fix PR 22106; make std::swap work for multi-dimensional arrays. Thanks to Peter Griess for the report and suggested fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 19:20:49 +00:00
Dan Albert
c101738156 Obey [atomics.types.operations.req]/21 for GCC.
Summary:
Excerpt from [atomics.types.operations.req]/21:

> When only one memory_order argument is supplied, the value of
> success is order, and the value of failure is order except that a
> value of memory_order_acq_rel shall be replaced by the value
> memory_order_acquire and a value of memory_order_release shall be
> replaced by the value memory_order_relaxed.

Clean up some copy pasta while I'm here (someone added a return
statement to a void function).

Reviewers: EricWF, jroelofs, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 18:39:37 +00:00
Dan Albert
656850f03e [libcxx] Set _LIBCPP_ELAST for mingw.
Reviewers: K-ballo, mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: jfb, jroelofs, majnemer, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06 17:34:51 +00:00
Chandler Carruth
7a033ca056 [cmake/multilib] Teach libc++'s CMake build to support multilib libdir
suffixes like 'lib64' or 'lib32'.

This support is currently very rhudimentary. We define a variable
LIBCXX_LIBDIR_SUFFIX. In a standalone build of libc++ this can be
directly set as a cached variable to control the multilib suffix used.
When building libc++ within a larger LLVM build, it is hard wired to
whatever LLVM libdir suffix has been selected. If this doesn't work for
someone, just let me know. I'm happy to change it.

This is essentially new functionality for libc++ so I don't expect it to
have any impact for folks until they start setting these variables.
However, I know libc++ is built in a diverse set of environments so just
let me know if this causes you any problems.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224926 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-29 12:15:47 +00:00
Eric Fiselier
60b3df404e Prevent ill-formed instantiation of __invoke_of<...> during the evaluation of a bind expression. Fixes PR22003.
The SFINAE on the function __mu(Fn, Args...) that evaluates nested bind
expressions always tries to deduce the return type for Fn(Args...) even when Fn
is not a nested bind expression. This can cause hard compile errors when the
instantation of Fn(Args...) is ill-formed. This patch prevents the instantation
of __invoke_of<Fn, Args...> unless Fn is actually a bind expression.

Bug reportand patch from Michel Morin.

http://llvm.org/bugs/show_bug.cgi?id=22003


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-23 05:54:34 +00:00
Marshall Clow
e26488fd83 Remove non-const test to get test passing. Will come back later and (correctly) add non-const tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224748 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-23 01:30:39 +00:00
Eric Fiselier
4eb5b6d5ee [libcxx] Consolidate new/delete replacement in tests and disable it when using sanitizers.
Summary:
MSAN and ASAN also replace new/delete which leads to a link error in these tests. Currently they are unsupported but I think it would be useful if these tests could run with sanitizers.

This patch creates a support header that consolidates the new/delete replacement functionality and checking.
When we are using sanitizers new and delete are no longer replaced and the checks always return true.

Reviewers: mclow.lists, danalbert, jroelofs, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224741 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22 22:38:59 +00:00
Eric Fiselier
71dc14e864 [libcxx] Add numerous options to libc++ LIT test suite configuration.
Summary:
In order to fully replace the testit script we need to update LIT so it provides the same functionality.
This patch adds a number of different configuration options to LIT to do that. It also adds documentation for all of the command line parameters that LIT supports.

Generic options added:
- `libcxx_headers`
- `libcxx_library`
- `compile_flags`


Generic options modified:
- `link_flags`: Changed from overriding the default args to adding extra args instead (to match compile flags)
- `use_sanitizer`: Renamed from `llvm_use_sanitizer`


Please see the added documentation for more information about the switches. As for the actual documentation I'm not sure if it should be kept in libc++ forever since it adds an undue maintenance burden, but I think it should be added for the time being while the changes are new. I'm verify unskilled with HTML so if the documentation needs any changes please let me know.

Hopefully this will kill testit.



Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: alexfh, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224728 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22 20:49:45 +00:00
Marshall Clow
0b16e8e05a Fix PR22000. __bit_iterator::move_backwards. Also make a note that __bit_iterator
is quite underrepresented in the libc++ tests suite.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-22 19:10:11 +00:00