Commit Graph

958 Commits

Author SHA1 Message Date
Ed Schouten
63e70b67eb Add support for arc4random() to random_device.
Nuxi CloudABI (https://github.com/NuxiNL/cloudlibc) does not allow
processes to access the global filesystem namespace. This breaks
random_device, as it attempts to use /dev/{u,}random. This change adds
support for arc4random(), which is present on CloudABI.

In my opinion it would also make sense to use arc4random() on other
operating systems, such as *BSD and Mac OS X, but I'd rather leave that
to the maintainers of the respective platforms. Switching to
arc4random() does change the ABI.

This change also attempts to make some cleanups to the code. It adds a
single #define for every random interface, instead of testing against
operating systems explicitly.

As discussed, also validate the token argument to be equal to
"/dev/urandom" on all systems that only provide pseudo-random numbers.
This should cause little to no breakage, as "/dev/urandom" is also the
default argument value.

Reviewed by: jfb
Differential Revision: http://reviews.llvm.org/D8134


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 07:46:06 +00:00
Eric Fiselier
9f4f2215b7 [libcxx] Fix __RAII_IncreaseAnnotator for increases >= 1
Summary: Fix suggested by @mclow.lists on D8109. Store the size of the un-poisoned vector upon construction instead of calculating it later.

Reviewers: titus, mclow.lists, kcc, EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231729 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 00:25:20 +00:00
Eric Fiselier
6e63e2974b Move test to use correct suffix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 21:30:48 +00:00
Eric Fiselier
3c7b80131b Add TrackedValue to test/support. Thanks to Louis Dionne
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231674 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 18:02:16 +00:00
Marshall Clow
d07fcd66b9 Fix an exception-safety bug in <deque>. Reference: PR#22650. Not closing the bug because there's more work to do here
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231672 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 17:08:51 +00:00
Ed Schouten
2020d8ac89 Add CloudABI locale names to platform_support.h.
On CloudABI we should append the timezone name to the end of the locale
(e.g., nl_NL.UTF-8@Europe/Amsterdam). By fixing the locale names we can
already let a lot of locale related tests pass.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 12:04:16 +00:00
Dan Albert
cebeadf30b Oops. This arg is passed, just ignored.
We should probably be using this argument to find the data files for
the tests, but that isn't implemented yet.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 18:51:25 +00:00
Dan Albert
ca27dd0a23 Fix the PrefixExecutor.
The PrefixExecutor wasn't passing the exe_path down the chain, so the
command was overriding that, the work_dir was being passed as the
command, and so on.

I've cleaned up a few pylint issues while I was here.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231496 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 18:35:45 +00:00
Eric Fiselier
ab2b9f526c Remove unneeded python import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231453 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 06:22:22 +00:00
Eric Fiselier
03e3302cc1 Run ShTests when the executor is an instance of LocalExecutor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231404 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 20:27:01 +00:00
Marshall Clow
3b1d283788 Move the <dynarray> tests out of the std/ hierarchy, since it's not really part of the standard any more.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 23:09:15 +00:00
Eric Fiselier
9c8e663ced Allow declaration of map and multimap iterator with incomplete mapped type. Patch from eugenis
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 20:10:01 +00:00
Marshall Clow
174b2b8acf Add better tests for ctype<char>::classic_table
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231077 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 16:15:26 +00:00
Eric Fiselier
c0b166e944 [libcxx] Add support for linking libc++ against a static ABI library.
Summary:
This patch add the CMake option `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` which, when enabled, will link libc++ against the static version of the ABI library.


Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: compnerd, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@231076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 15:59:51 +00:00
Jonathan Roelofs
83d7735487 Add remote testing support to the lit config.
Executors can be specified at configure time by using the -DLIBCXX_EXECUTOR=""
option. Examples include:

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="TimeoutExecutor(30,LocalExecutor())"
      This runs individual tests with a maximum duration

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="SSHExecutor('hostname','username')"
      This runs tests on a remote target, using scp to shuttle binaries to the
      target, and ssh to invoke commands there.

  $ cmake <other_flags> -DLIBCXX_EXECUTOR="PrefixExecutor('/path/to/run/script',LocalExecutor())"
      This assumes the script knows how to copy run the executables passed to it,
      and allows for the ultimate control. This is useful for running things
      inside emulators like Valgrind & QEMU.

TODO: This doesn't claim to support ShTest tests yet, that will take a bit more
  thought & finagling (I'm still not sure how to orchestrate copy-in for those cases.

  I've also punted on what to do about tests that read data files. The testsuite
  has several tests that need to read *.dat files placed next to them, and
  currently those aren't copied over when using, say, an SSHExecutor. The
  affected tests are:

     libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
     libc++ :: std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
     libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
     libc++ :: std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp

Note: One thing to watch out for when using the SSHExecutor for cross-testing is
  that you'll also want to specify a TargetInfo object (so that the host's
  features aren't used for available-features checks and flags setup).

http://reviews.llvm.org/D7380


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 00:42:17 +00:00
Eric Fiselier
40310ac76c Remove XFAIL on string view test for apples clang compiler. Thanks to Marshall for the fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 10:52:07 +00:00
Eric Fiselier
da1818a08c [libc++] Try and prevent evaluation of is_default_constructible on tuples default constructor if it is not needed.
Summary:
Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should.

```

#include <type_traits>

template <class T>
struct IllFormedDefaultImp {
    IllFormedDefaultImp(T x) : value(x) {}
    constexpr IllFormedDefaultImp() {}
    T value;
};

typedef IllFormedDefaultImp<int &> IllFormedDefault;

template <class T, class U>
struct pair
{
  template <bool Dummy = true,
    class = typename std::enable_if<
         std::is_default_constructible<T>::value
      && std::is_default_constructible<U>::value
      && Dummy>::type
    >
  constexpr pair() : first(), second() {}

  pair(T const & t, U const & u) : first(t), second(u) {}

  T first;
  U second;
};

int main()
{
  int x = 1;
  IllFormedDefault v(x);
  pair<IllFormedDefault, IllFormedDefault> p(v, v);
}
```

One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple.


Reviewers: mclow.lists, rsmith, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: ldionne, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:30:41 +00:00
Eric Fiselier
45969ecfcd [libcxx] Move to using libc++abi2.exp as the default symbol list for libc++
Summary:
libc++abi2.exp should be used whenever `cxxabi.h` defines `_LIBCPPABI_VERSION`. This macro was added to libc++abi in 2012 in r149632. For this reason we should use libc++abi2.exp as default unless otherwise specified.

Also when building against an in-tree libc++abi we definitely want to use libc++abi2.exp.

I would love to know what OSX was the last to use libc++abi.exp but I can only test on 10.9.


Reviewers: danalbert, mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: meadori, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@230119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:26:24 +00:00
Larisse Voufo
74f95a01cd More on adding sized deallocation functions in libc++: Continuing from r229281, this adds version guards and test cases.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229968 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 06:13:05 +00:00
Eric Fiselier
d75a44ba24 Fix incorrect locale mapping in config.py on OSX
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229935 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 23:57:46 +00:00
Eric Fiselier
8a8aae4618 Move to using -fdiagnostics-color=always on both GCC and Clang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 23:26:54 +00:00
Eric Fiselier
784fa1eeba Mark more tuple tests as unsupported in C++98 && C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229810 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 02:44:09 +00:00
Eric Fiselier
f063052fe1 [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.
Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 02:10:42 +00:00
Eric Fiselier
cc3ea928ae [libcxx] Tired of colorless compile errors? Enable color diagnostics today!
Summary:
This patch adds a lit option to enable color diagnostics when either `--param=color_diagnostics` is passed to LIT or `LIBCXX_COLOR_DIAGNOSTICS` is present in the environment.

My only concern with this patch is that GCC and Clang take different flags and that only GCC 4.9 and greater support `-fdiagnostics-color=always`

Does anybody have objections to this going in?

Reviewers: jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229707 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 17:39:45 +00:00
Eric Fiselier
3f370b0a55 Enable testing with _LIBCPP_DEBUG and fix bad assertions in string_view.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 17:00:31 +00:00
Eric Fiselier
89465dce7c [libc++] Fix PR20084 - std::is_function<void() const> failed.
Summary:
This patch introduces some black magic to detect const and volatile qualified function types such as `void () const`.

The patch works in the following way:

We first rule out any type that satisfies on of the following. These restrictions are important so that the test below works properly.
* `is_class<_Tp>::value`
* `is_union<_Tp>::value`
* `is_void<_Tp>::value`
* `is_reference<_Tp>::value`
* `__is_nullptr_t<_Tp>::value`


If none of the above is true we perform overload resolution on `__source<_Tp>(0)` to determine the return type.
*  If `_Tp&` is well-formed we select `_Tp& __source(int)`. `_Tp&` is only ill formed for cv void types and cv/ref qualified function types.
* Otherwise we select `__dummy_type __source(...)`. Since we know `_Tp` cannot be void then it must be a function type.


let `R` be the returned from `__source<_Tp>(0)`. 
We perform overload resolution on `__test<_Tp>(R)`.
* If `R` is `__dummy_type` we call `true_type __test(__dummy_type)`.
* if `R` is `_Tp&` and `_Tp&` decays to `_Tp*` we call `true_type __test(_Tp*)`.  Only references to function types decay to a pointer of the same type.
* In all other cases we call `false_type __test(...)`. 

`__source<_Tp>(0)` will try and form `_Tp&`  in the return type. if `_Tp&` is not well formed the return type of `__source<_Tp>(0)` will be dummy type. `_Tp&` is only ill-formed for cv/ref qualified function types (and void which is dealt with elsewhere).


This fixes PR20084 - http://llvm.org/bugs/show_bug.cgi?id=20084

Reviewers: rsmith, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18 16:31:46 +00:00
Eric Fiselier
13b96fdfbd [libcxx] Add <experimental/ratio>
Summary:
This patch is pretty simple. It just adds the _v traits from <ratio>. 

The draft can be found here.

Reviewers: jroelofs, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 16:52:03 +00:00
Marshall Clow
6bcbced54f Rooting out more undefined behavior in char_traits.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229119 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 16:04:42 +00:00
Jonathan Roelofs
c3068a136a Appease buildbots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 15:34:01 +00:00
Jonathan Roelofs
4205190e07 Modularize TargetInfo discovery in the lit config
When the remote execution patch lands, this will allow us to drop in a
replacement TargetInfo object for locale support discovery, alleviating
the assumption that host==target.

http://reviews.llvm.org/D7601


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 15:25:21 +00:00
Dan Albert
1bd299a58e Fix error checking in get_temp_file_name().
Checking errno without first checking that the call failed means that
if some other call prior to mkstemp failed with EINVAL prior to this,
the assert would fire even if mkstemp succeeded. If something failed
with EEXIST, it would go in to an infinite loop.

Change-Id: I3f140a3e15fe08664a38a8c9a950c4ed547eb481

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@229035 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 03:02:28 +00:00
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
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