Commit Graph

1729 Commits

Author SHA1 Message Date
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
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
Justin Bogner
6cf4f15970 Revert "Fix installheaders target's permissions"
The install of headers excludes the support directory, so these chmod
calls fail on non-existent directories, as seen on this bot:

http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/2801/console

This reverts commit r224300.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 05:28:07 +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
Marshall Clow
a1a4db3fe5 Comment out the breaking tests until I figure out what's going on here.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224301 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 00:59:59 +00:00
Jonathan Roelofs
a2ef609ff1 Fix installheaders target's permissions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224300 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 00:48:13 +00:00
Marshall Clow
e51267e2d1 Once more w/o the typo.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224298 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 00:46:23 +00:00
Marshall Clow
cde7ca0a97 Fix the literal string that I said would be six elements long to actually be six elements long. Octal. Sheesh.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224297 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 00:45:47 +00:00
Marshall Clow
ab3c50593c Add test to ensure that iterator_traits<NotAnIterator> doesn't have a value type
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224295 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-16 00:30:07 +00:00
Marshall Clow
e3e7054f48 Implement LWG 2217 - operator==(sub_match, string) slices on embedded '\0's
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224292 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 23:57:56 +00:00
Eric Fiselier
9acbcee2c6 Add option to turn off installation of headers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224162 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 22:52:58 +00:00
Sergey Dmitrouk
984f8f6e43 Include newlib-specific locales in __locale
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 08:36:16 +00:00
Eric Fiselier
ae9fec0bdf Add support for building libc++ as a 32 bit library
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 03:12:18 +00:00
Eric Fiselier
01f6a1410c Fix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI are turned off.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224095 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12 02:36:23 +00:00
Jonathan Roelofs
08e3a7887f Add 'REQUIRES: long_tests' to one more long test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224069 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 22:27:49 +00:00
Jonathan Roelofs
5030eaf65d Add 'REQUIERS: long_tests' to a few more long tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224064 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 22:05:18 +00:00
Jonathan Roelofs
2f2daa1436 Fix platform_support.h's get_temp_file_name() on Newlib under __STRICT_ANSI__
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224057 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 20:56:40 +00:00
Jonathan Roelofs
cddec8a9dd Add an XFAIL for Newlib's missing uchar.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224037 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 19:11:39 +00:00
Jonathan Roelofs
d9144e8d17 Mark a bunch of long running tests as 'REQUIRES: long_tests'
This lets us skip them as UNSUPPORTED on slow systems like QEMU


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 18:35:36 +00:00
Jonathan Roelofs
952438bf70 Mark some more fenv tests as UNSUPPORTED by newlib
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224024 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 16:17:26 +00:00
Jonathan Roelofs
f2bd5a0fe1 Add an XFAIL for Newlib's missing fenv.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224021 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11 15:37:22 +00:00
Eric Fiselier
453a50040b Update information on where to find buildbots. Remove dead buildbot links.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223848 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 22:53:21 +00:00
Marshall Clow
8283709e91 Move the optional tests into test/experimental. They were put into test/utilities because optional was going to be part of C++14, and then was pulled and put into the Library Fundamentals TS instead. No funcitonality change here; just moving files around.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223778 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 15:07:42 +00:00
Marshall Clow
4ad67e08cb Add all the relational operators to std::experimental::optional. Also update bad_optional_access to match the Library Fundamentals draft standard. This is not all of the upcoming changes to optional, though.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223775 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 14:49:17 +00:00
Sergey Dmitrouk
fff544efbd Explicitly include <sched.h> for sched_yield()
It might be implicitly included by <pthread.h> (and that's why it worked
so far), but it's not guaranteed (for example, this is not the case with
newlib).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 14:50:21 +00:00
Eric Fiselier
2764d046a1 Give lit.cfg's threading options default values when not defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223601 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 08:52:19 +00:00
Eric Fiselier
427f1a3014 Mark a couple of tests as XFAIL with older compilers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223600 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 05:31:17 +00:00
Eric Fiselier
cd83c78703 Consolidate error reporting in lit.cfg
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223599 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 04:28:50 +00:00
Eric Fiselier
2050be27a4 Revert parts of r223594. Use DYLD_LIBRARY_PATH on OSX when running tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223598 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 00:34:23 +00:00
Eric Fiselier
74e7af0d75 Fix apple clang detection in lit.cfg
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223597 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 22:49:38 +00:00
Eric Fiselier
83313c7ee8 Unify and cleanup rpath handling in tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223594 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 22:08:51 +00:00
Eric Fiselier
c934ca7237 [libcxx] Add logic to probe compiler in tests.
Summary:
This patch probes the cxx compiler used during testing by getting it to dump its predefined macros. Based on the value of these macros the compiler name and compiler name + version are added to the available features.

There are three compiler names:
- `clang`
- `apple-clang`
- `gcc`.

The available features added are equivalent to:
- `'%s' % compiler_name`
- `'%s-%s.%s' % compiler_name, major_version, minor_version`

This information can be used to XFAIL tests on different compilers / versions.



Reviewers: mclow.lists, danalbert, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 21:13:15 +00:00
Eric Fiselier
7330ed3228 Add support for building and testing libc++ without threads to CMake.
Currently hacks must be used in to configure and build libc++ without threads
when using CMake. This patch adds CMake options to enable/disable building with
threads and a monotonic clock.

This patch also propagates the configuration information to lit so the tests
are properly configured as well.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223591 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 21:02:58 +00:00
Eric Fiselier
a245f9b263 Improve error message when _LIBCPP_HAS_NO_MONOTONIC_CLOCK is used improperly
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 20:09:11 +00:00
JF Bastien
93cfd7fc4e libc++: support NaCl when building thread.cpp
Summary: NaCl shouldn't include sysctl.h when trying to determine std:🧵:hardware_concurrency, it should instead use sysconf(_SC_NPROCESSORS_ONLN) through unistd.h. No test needs to be changed, since hardware_concurrency.pass.cpp already tests that std:🧵:hardware_concurrency > 0.

Test Plan: make check-libcxx

Reviewers: dschuff, danalbert

Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223128 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02 17:30:19 +00:00
JF Bastien
2bd5ffd330 libc++: add NaCl and PNaCl support for std::random_device
Summary:
The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.

This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).

Test Plan: ninja check-libcxx

Reviewers: dschuff, mclow.lists, danalbert

Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223068 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01 19:19:55 +00:00
JF Bastien
6317e9b85a libc++: integral types trap on PNaCl
Reviewers: dschuff, danalbert

    Subscribers: jfb, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222842 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-26 17:51:58 +00:00
Eric Fiselier
6cb69ffa0a Fixes to get libc++ building on sun solaris. Patch from C Bergstrom.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222794 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 21:57:41 +00:00
Eric Fiselier
bd0000808d Use lit.util.executeCommand instead of our own version
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222717 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-25 03:03:32 +00:00
Eric Fiselier
e6e69df598 Print lit configuration information after all configuration is done.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222711 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-24 23:46:42 +00:00