Commit Graph

835 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
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
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
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
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
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
Eric Fiselier
814b625303 Move unconditional test compile and link flags into their configuration functions.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224674 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-20 04:14:14 +00:00
Eric Fiselier
4778eed34f [libcxx] Teach libcxx's lit configuration new ways to find lit.site.cfg
Summary:
Currently to run tests in tree you need to symlink the lit.site.cfg file generated by the cmake build into the source tree, and teach your VCS to ignore it.

This allows the user to specify where to find the lit.site.cfg file two different ways:
* lit_site_config lit parameter
* LIT_SITE_CONFIG enviroment variable. 

example usage:
```
lit -sv --param=libcxx_site_config=path/to/libcxx-build/test/lit.site.cfg path/to/tests
```
Or
```
export LIBCXX_SITE_CONFIG=path/to/libcxx-build/test/lit.site.cfg
lit -sv path/to/tests
```
The command line parameter will override the environment variable. 
If neither options are present a warning is issued and the `lit.cfg` file is loaded directly. 


Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: ddunbar, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224671 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-20 03:16:55 +00:00
Eric Fiselier
a90c6dd460 Move test into test/std subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-20 01:40:03 +00:00
Eric Fiselier
669a8a5a19 [libcxx] Add <experimental/type_traits> for LFTS
Summary:
This adds the <experimental/type_traits> (minus invocation traits). Mostly just the `_v` traits.


Reviewers: K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224626 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-19 22:21:44 +00:00
Eric Fiselier
bd8adae47f Remove unneeded configuration code.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224618 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-19 21:42:17 +00:00
Eric Fiselier
b8e76804f1 [libcxx] Allow the use of ccache when running the test suite.
Summary:
In order to get the bots running quicker I would like to be able to use ccache 
with the test suite. This patch adds support for running the test suite using 
ccache. To use ccache pass `--param=use_ccache=true` when running the test suite.

ccache will not cache any command that invokes ld, so the build step needs to be
split into two separate compile commands. The cost of splitting the build step
into two parts when not using ccache seems to be minimal. On my machine I saw a
difference of ~5 seconds on a 5 minute test suite run.

A full test suite run with ccache generates about 250MB of cached data.

I recorded the following times for running the test suite in the following configurations:
- no ccache: 340s
- initial ccache run: 380s
- rerun with ccache (no changes): 53s.
- rerun with ccache (<string> changed): 80s
- rerun with ccache (<cmath> changed): 169s
- rerun with ccache (<valarray> changed): 69s





Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: jroelofs

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-19 19:27:32 +00:00
Marshall Clow
4975bad299 Re-commit the test for regex that I busted last night - now passes under ASAN
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224342 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 16:22:43 +00:00
Jonathan Roelofs
7797c867d3 Appease the c++14 buildbots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224304 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 01:18:11 +00:00