Commit Graph

1765 Commits

Author SHA1 Message Date
Jonathan Roelofs 3ad99f0f2e Fix lit config typo
llvm-svn: 226749
2015-01-22 00:05:11 +00:00
Duncan P. N. Exon Smith 53afae49ee tuple: Make operator<() linear instead of exponential
Patch by Matthew Dempsky!

llvm-svn: 226641
2015-01-21 02:51:17 +00:00
Eric Fiselier 4ac5a9e92c Only use -target flag when target_triple is manually specified
llvm-svn: 226615
2015-01-20 22:37:25 +00:00
Eric Fiselier 4b8985b545 Print compiler path during configuration and pass more flags to the linker
llvm-svn: 226576
2015-01-20 16:26:48 +00:00
Eric Fiselier 747c0fda5d 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.

llvm-svn: 226575
2015-01-20 16:14:18 +00:00
Marshall Clow eb9bfac876 Cleaning up the test suite; remove some includes of non-standard file <__config>
llvm-svn: 226411
2015-01-18 19:05:51 +00:00
Eric Fiselier 7b269d0af5 A couple small changes to get LIT working with python3
llvm-svn: 226330
2015-01-16 21:59:07 +00:00
Eric Fiselier b0478741ca [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

llvm-svn: 226323
2015-01-16 21:35:08 +00:00
Eric Fiselier a745465ae4 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.

llvm-svn: 226322
2015-01-16 21:22:08 +00:00
Dan Albert e39fb93cf3 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.

llvm-svn: 226243
2015-01-16 02:27:17 +00:00
Dan Albert db56013cd1 [libc++] Add support for cross compiling.
Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 226237
2015-01-16 00:55:15 +00:00
Jonathan Roelofs 0c69163a42 Print out environment in lit notes
llvm-svn: 226223
2015-01-15 23:04:37 +00:00
Dan Albert 8a894a456c Use set() instead of option() for string option.
Fixes issue in r226185.

llvm-svn: 226192
2015-01-15 18:56:45 +00:00
Dan Albert b3db76622b Add a cmake option for LIT configuration variant.
llvm-svn: 226185
2015-01-15 18:35:04 +00:00
Jonathan Roelofs 13be264db2 Refactor configure_link_flags for modularity. NFC
llvm-svn: 226174
2015-01-15 16:18:13 +00:00
Jonathan Roelofs 015cf55c71 Rename src_root -> libcxx_src_root. NFC
llvm-svn: 226063
2015-01-15 00:03:14 +00:00
Jonathan Roelofs eb7b5e74d4 Rename system_lib -> system_cxx_lib. NFC
llvm-svn: 226061
2015-01-14 23:38:12 +00:00
Jonathan Roelofs e5f997e551 Rename library_root to libcxx_library_root. NFC
llvm-svn: 226043
2015-01-14 21:56:50 +00:00
Jonathan Roelofs da5a97594a Refactor configure_compile_flags. NFC
llvm-svn: 226040
2015-01-14 21:02:14 +00:00
Jonathan Roelofs fd41e2f946 Support picking the unwinder used for testing on linux (just as libc++abi testing allows)
llvm-svn: 226024
2015-01-14 19:29:04 +00:00
Jonathan Roelofs b9d33419fb Fix a lit configuration diagnostic. NFC
llvm-svn: 225985
2015-01-14 14:48:27 +00:00
Jonathan Roelofs 9144235617 Refactor the lit config's linker flag discovery code. NFC
llvm-svn: 225920
2015-01-14 01:29:04 +00:00
Marshall Clow 9db9069cf3 Make regex::assign not clobber the regex in case of failure. Fixes PR#22213
llvm-svn: 225799
2015-01-13 16:49:52 +00:00
Eric Fiselier 4fc4864bbd Fix vexing parse in test.
llvm-svn: 225633
2015-01-12 15:56:41 +00:00
Marshall Clow 612c2c7469 One more #include request in the test suite from Walter Brown
llvm-svn: 225609
2015-01-11 18:07:06 +00:00
Marshall Clow 9317900590 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.
llvm-svn: 225598
2015-01-11 06:15:59 +00:00
Jonathan Roelofs cba3e4ca21 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

llvm-svn: 225563
2015-01-10 00:08:00 +00:00
Marshall Clow e21582e742 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.
llvm-svn: 225541
2015-01-09 20:25:52 +00:00
Dan Albert 2bcfc6f95e [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

llvm-svn: 225532
2015-01-09 18:03:29 +00:00
Marshall Clow 3e33d11b06 K-Ballo found a place where we were using 'V' as a template parameter. Replace with '_Vp' for protection against user-defined macros.
llvm-svn: 225527
2015-01-09 17:03:36 +00:00
Marshall Clow a257ab0803 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.
llvm-svn: 225430
2015-01-08 06:36:41 +00:00
Marshall Clow c51d3ecb98 Add checks to make sure the hash functor has the right typedefs
llvm-svn: 225429
2015-01-08 06:18:59 +00:00
Marshall Clow 6855c93ce9 Missed a typename
llvm-svn: 225408
2015-01-07 22:26:48 +00:00
Marshall Clow d95510ebba 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.
llvm-svn: 225403
2015-01-07 21:53:23 +00:00
Marshall Clow 601fa8d824 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.
llvm-svn: 225402
2015-01-07 21:51:30 +00:00
Marshall Clow 842b4aecf8 Add tests to check the typedefs from the result of std::owner_less
llvm-svn: 225381
2015-01-07 20:54:51 +00:00
Marshall Clow 9570e7b04a Missed one comparison test in r225375
llvm-svn: 225376
2015-01-07 20:40:28 +00:00
Marshall Clow 66369c03a3 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.
llvm-svn: 225375
2015-01-07 20:31:06 +00:00
Dan Albert d5c19bb16d 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.

llvm-svn: 225300
2015-01-06 22:18:27 +00:00
Dan Albert 23f19e9ac4 Make a test UNSUPPORTED if libcpp-has-no-threads.
llvm-svn: 225287
2015-01-06 19:32:30 +00:00
Dan Albert 658ed010a6 Appease MSAN buildbots.
This is just a compile time test, but we have MSAN buildbots that will
fail since `exp` was uninitialized.

llvm-svn: 225286
2015-01-06 19:23:25 +00:00
Marshall Clow d632356aa3 Fix PR 22106; make std::swap work for multi-dimensional arrays. Thanks to Peter Griess for the report and suggested fix
llvm-svn: 225285
2015-01-06 19:20:49 +00:00
Dan Albert 872bad5ab7 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

llvm-svn: 225280
2015-01-06 18:39:37 +00:00
Dan Albert a76dfbd428 [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

llvm-svn: 225273
2015-01-06 17:34:51 +00:00
Chandler Carruth 64be05a873 [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.

llvm-svn: 224926
2014-12-29 12:15:47 +00:00
Eric Fiselier 279663c1b4 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

llvm-svn: 224753
2014-12-23 05:54:34 +00:00
Marshall Clow 09ac1efe14 Remove non-const test to get test passing. Will come back later and (correctly) add non-const tests
llvm-svn: 224748
2014-12-23 01:30:39 +00:00
Eric Fiselier 2cbc654d93 [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

llvm-svn: 224741
2014-12-22 22:38:59 +00:00
Eric Fiselier 19c07165d1 [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

llvm-svn: 224728
2014-12-22 20:49:45 +00:00
Marshall Clow 08de4b0d4e Fix PR22000. __bit_iterator::move_backwards. Also make a note that __bit_iterator
is quite underrepresented in the libc++ tests suite.

llvm-svn: 224723
2014-12-22 19:10:11 +00:00