Commit Graph

1951 Commits

Author SHA1 Message Date
Eric Fiselier f7d36ac5f0 Remove XFAIL on string view test for apples clang compiler. Thanks to Marshall for the fix
llvm-svn: 230322
2015-02-24 10:52:07 +00:00
JF Bastien 2ca8c6b9ca Reword ELAST warning
Summary:
GCC emits a pretty amusing warning when there are apostrophes in a #warning:
```warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]```

Reword the warning to avoid this, and be more consistent with other warnings in libc++.

Reviewers: danalbert

Subscribers: llvm-commits

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

llvm-svn: 230298
2015-02-24 01:59:38 +00:00
Marshall Clow 0168d34e23 Change string_view::at to make it work with gcc and VC++. Thanks to K-ballo for the bug report, and Jonathan Wakeley for the code review in the bar.
llvm-svn: 230260
2015-02-23 21:12:02 +00:00
Eric Fiselier 65500d4b29 [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

llvm-svn: 230120
2015-02-21 02:30:41 +00:00
Eric Fiselier d2852b69ce [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

llvm-svn: 230119
2015-02-21 02:26:24 +00:00
Larisse Voufo da577b860a Add self to CREDITS.TXT
llvm-svn: 229969
2015-02-20 06:17:20 +00:00
Larisse Voufo e4864e0bc2 More on adding sized deallocation functions in libc++: Continuing from r229281, this adds version guards and test cases.
llvm-svn: 229968
2015-02-20 06:13:05 +00:00
Eric Fiselier c50b75c75c Fix incorrect locale mapping in config.py on OSX
llvm-svn: 229935
2015-02-19 23:57:46 +00:00
Eric Fiselier 801e71129f Move to using -fdiagnostics-color=always on both GCC and Clang
llvm-svn: 229927
2015-02-19 23:26:54 +00:00
Marshall Clow 09921a571f Make basic_streambuf::xsputn write characters in chunks whenever possible, instead of one at a time. References PR#10193
llvm-svn: 229866
2015-02-19 16:17:46 +00:00
Eric Fiselier 2d38959cd9 Mark more tuple tests as unsupported in C++98 && C++03
llvm-svn: 229810
2015-02-19 02:44:09 +00:00
Eric Fiselier 0a52cd7937 [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

llvm-svn: 229808
2015-02-19 02:10:42 +00:00
Marshall Clow 7c78beac5d Remove several unused forward declarations. Fixes PR22605.
llvm-svn: 229728
2015-02-18 19:28:35 +00:00
Marshall Clow 3afa22a3e7 Move the default template arguments into the forward declarations for the container adapters: stack and queue. References PR#22605.
llvm-svn: 229708
2015-02-18 17:51:56 +00:00
Eric Fiselier da52c55fc3 [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

llvm-svn: 229707
2015-02-18 17:39:45 +00:00
Marshall Clow b5d34aa419 Move the default template arguments into the forward declarations for the containers: deque, forwardlist and list. References PR#22605.
llvm-svn: 229705
2015-02-18 17:24:08 +00:00
Eric Fiselier 938d957d2e Enable testing with _LIBCPP_DEBUG and fix bad assertions in string_view.
llvm-svn: 229698
2015-02-18 17:00:31 +00:00
Eric Fiselier 9317721beb [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

llvm-svn: 229696
2015-02-18 16:31:46 +00:00
Eric Fiselier 959e828b51 [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

llvm-svn: 229509
2015-02-17 16:52:03 +00:00
Larisse Voufo d36bd70059 Implement C++14's sized deallocation functions, since there are no longer implicitly defined by clang, as of r229241.
llvm-svn: 229281
2015-02-15 05:18:55 +00:00
Saleem Abdulrasool 8e5ce33193 Handle function name conflicts in _LIBCPP_MSVCRT mode
Visual Studio's SAL extension uses a macro named __deallocate. This macro is
used pervasively, and gets included through various different ways. This
conflicts with the similarly named interfaces in libc++. Introduce a undef
header similar to __undef_min_max to handle this. This fixes a number of errors
due to the macro replacing the function name.

llvm-svn: 229162
2015-02-13 22:15:32 +00:00
Saleem Abdulrasool 4ef8ac946c cctype: tweak inclusions for _LIBCPP_MSVCRT case
cctype uses ctype functions such as isblank. However, when building against
msvcrt, this is provided by the support header. Include the support header if
building for Windows to ensure that the definition is properly visible.

llvm-svn: 229161
2015-02-13 22:15:28 +00:00
Marshall Clow 9a7971131e Rooting out more undefined behavior in char_traits.
llvm-svn: 229119
2015-02-13 16:04:42 +00:00
Jonathan Roelofs 272dcdc4a5 Appease buildbots
llvm-svn: 229114
2015-02-13 15:34:01 +00:00
Jonathan Roelofs a61779e67a 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

llvm-svn: 229111
2015-02-13 15:25:21 +00:00
Dan Albert 0b15b14096 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
llvm-svn: 229035
2015-02-13 03:02:28 +00:00
Marshall Clow f3e0e3acda Move the test for zero-length into the char_traits (from string_view). Add tests to char_traits specializations
llvm-svn: 228981
2015-02-12 23:34:52 +00:00
Marshall Clow 8037b8ec6e Fixed a problem that UBSAN found, where we were calling memcmp(null, p, 0) - which is undefined behavior
llvm-svn: 228952
2015-02-12 19:58:06 +00:00
Marshall Clow c08e8f81ec Remove undefined behavior from test; specifically, compare(NULL, XXX, 0)
llvm-svn: 228928
2015-02-12 15:25:54 +00:00
Marshall Clow 351dde4e03 Remove undefined behavior from test; specifically, compare(NULL, XXX, 0). Thanks to Eric for the catch
llvm-svn: 228927
2015-02-12 15:21:20 +00:00
Marshall Clow 88d21343df Change some template parameter names from _C and _N to _Cont and _Sz. No functionality change.
llvm-svn: 228843
2015-02-11 16:14:01 +00:00
Marshall Clow 5f15a8b959 Need to wrap a bit in an ifdef, since there are no initializer_lists in C++03
llvm-svn: 228840
2015-02-11 15:48:21 +00:00
Marshall Clow 002144f61d Fix PR 22541: When values are equal, minmax should return the rightmost one in the initializer_list
llvm-svn: 228839
2015-02-11 15:41:34 +00:00
Eric Fiselier fe21713e2a Update double_include.sh.cpp for new headers.
llvm-svn: 228784
2015-02-11 01:31:02 +00:00
Eric Fiselier bb185a0a9e 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

llvm-svn: 228783
2015-02-11 01:25:57 +00:00
Eric Fiselier 58e985c2db Make convert_to_integral.pass.cpp more platform generic.
Don't depend on the underlying types of enums and wchar_t.

llvm-svn: 228781
2015-02-11 01:18:05 +00:00
Eric Fiselier e9bfd88e4b Remove default definition for libcxx_obj_dir because it doesn't make sense
llvm-svn: 228778
2015-02-11 01:03:44 +00:00
Dan Albert 86cc60eeea Make ABI header not found a warning, not an error.
Since we've added a new header to libc++abi (__cxxabi_config.h), we
now have a case where we might not always find all the ABI headers:
building libc++ against the system's libc++abi on Darwin.

Since this isn't actually a fatal error, degrade it to a warning.

llvm-svn: 228720
2015-02-10 18:46:57 +00:00
Eric Fiselier cc2e1ab69c Add pragma system header to some experimental headers and add newlines to files.
llvm-svn: 228712
2015-02-10 17:32:49 +00:00
Eric Fiselier 861d0ea2aa Fix more issues exposed by -pedantic-errors in c++03 mode
llvm-svn: 228711
2015-02-10 17:20:18 +00:00
Eric Fiselier 8f55e62990 Remove use of zero length arrays in tests. Get tests passing with -pedantic-errors
llvm-svn: 228706
2015-02-10 16:51:29 +00:00
Eric Fiselier 54519a6be9 [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

llvm-svn: 228705
2015-02-10 16:48:45 +00:00
Eric Fiselier 51544023a9 [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

llvm-svn: 228704
2015-02-10 16:46:42 +00:00
Eric Fiselier 85b788c9c2 Fix use of C++11 extensions in C++03 code.
llvm-svn: 228698
2015-02-10 15:17:46 +00:00
Dan Albert 271e2646e8 Add __cxxabi_config.h to libcxxabi headers.
llvm-svn: 228364
2015-02-05 23:56:33 +00:00
Eric Fiselier 6fe361c1ef Remove use of _[A-Z] identifiers and poison them to detect usage
llvm-svn: 228353
2015-02-05 23:01:40 +00:00
Eric Fiselier c281a7a19f Get tests running with warnings. Fix warnings in headers and tests
llvm-svn: 228344
2015-02-05 20:28:37 +00:00
Dimitry Andric b1e78df0fa Fix unused private field warning in stdexcept after r207695.
Add a new _LIBCPP_UNUSED define in __config, which can be used to
indicate explicitly unused items, and apply it to the __imp__ field of
__libcpp_refstring.

Somebody who knows about Microsoft C++ and IBM C++ should fill in the
unused attribute syntax appropriate for those compilers, if there is
any.

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

llvm-svn: 228281
2015-02-05 07:40:48 +00:00
Dimitry Andric 7e187f1be9 Test commit: remove whitespace at EOL.
llvm-svn: 228280
2015-02-05 07:26:14 +00:00
Dan Albert 8645ea65e5 Fix some -Wundef issues.
llvm-svn: 228266
2015-02-05 02:34:59 +00:00
JF Bastien 7b683b43be libc++: remove unused variable in random_device::operator()()
Reviewers: jvoung

Subscribers: cfe-commits

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

llvm-svn: 228183
2015-02-04 20:25:57 +00:00
Eric Fiselier 3d2111e43b add platform to LIT's available features
llvm-svn: 228071
2015-02-03 23:49:58 +00:00
Eric Fiselier 5b67ed496e Fix alignment in tests for readability.
llvm-svn: 228028
2015-02-03 21:00:15 +00:00
Greg Fitzgerald 2e18729bce 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

llvm-svn: 228005
2015-02-03 18:47:37 +00:00
Greg Fitzgerald 57775cd66f Revert "Don't assume LIT_EXECUTABLE points to a Python script"
This reverts r227994

llvm-svn: 227996
2015-02-03 18:16:47 +00:00
Greg Fitzgerald d9ecf1ae7c 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

llvm-svn: 227994
2015-02-03 18:02:04 +00:00
Eric Fiselier 0285fc869d Mark <experimental/system_error> as complete
llvm-svn: 227974
2015-02-03 16:04:45 +00:00
Eric Fiselier 7bffc89cb9 [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

llvm-svn: 227973
2015-02-03 16:03:24 +00:00
Jonathan Roelofs 07d9d76a2d Revert: Revert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc
EricWF has updated the compilers on his buildbots. Hopefully they won't crash now.

llvm-svn: 227971
2015-02-03 15:34:17 +00:00
Eric Fiselier 9ba5c11b99 Rename pow2 functions in __hash_table to reflect that they are hash specific
llvm-svn: 227866
2015-02-02 21:31:48 +00:00
Eric Fiselier a261064483 Update LFTS status page
llvm-svn: 227862
2015-02-02 21:10:21 +00:00
Eric Fiselier 2f746d4c94 [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

llvm-svn: 227860
2015-02-02 21:05:47 +00:00
Marshall Clow b9595b79f2 Fix PR#22433. The algorithm is_partitioned was testing an item in the middle of the sequence twice.
llvm-svn: 227824
2015-02-02 18:16:35 +00:00
Marshall Clow 0b48cf9a62 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.
llvm-svn: 227811
2015-02-02 17:35:53 +00:00
Marshall Clow 526e0929a5 Reorder a couple of operations in inplace_merge so that we can meet the complexity guidelines mandated by the standard. References PR22427
llvm-svn: 227808
2015-02-02 16:44:11 +00:00
Jonathan Roelofs ef66a6f40c Revert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc
This change is causing a driver crash on libcxx-libcxxabi-x86_64-linux-ubuntu-msan

llvm-svn: 227806
2015-02-02 15:56:43 +00:00
Jonathan Roelofs 8468bbb993 Use fseek/ftell instead of fseeko/ftello when Newlib is the libc
http://reviews.llvm.org/D6626

llvm-svn: 227804
2015-02-02 15:04:29 +00:00
Dan Albert b2c9c3cfce Add myself to CREDITS.TXT.
llvm-svn: 227630
2015-01-30 22:40:31 +00:00
Dan Albert 2477bed098 Update web page to direct patches to Phabricator.
llvm-svn: 227629
2015-01-30 22:33:41 +00:00
Marshall Clow 538fec0e59 Fix for PR22061 by K-ballo
llvm-svn: 227384
2015-01-28 22:22:35 +00:00
Marshall Clow 949389c395 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.
llvm-svn: 227370
2015-01-28 21:22:53 +00:00
Marshall Clow c57d98ae86 Removed some tabs that snuck into the test suite. No functionality change
llvm-svn: 227363
2015-01-28 20:26:11 +00:00
Marshall Clow d5f461ca03 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.
llvm-svn: 227359
2015-01-28 19:54:25 +00:00
Eric Fiselier b06fe2a704 Fix flag order of -xc++ in CXXCompiler.
llvm-svn: 227273
2015-01-28 00:05:48 +00:00
Eric Fiselier 9ec188db33 Fix definition of __has_feature in r227263
llvm-svn: 227264
2015-01-27 23:05:41 +00:00
Eric Fiselier 5a4ee414d8 Ensure __has_feature is defined in test/support/count_new.hpp
llvm-svn: 227263
2015-01-27 23:03:38 +00:00
Eric Fiselier 9e2b7639df Fix linking pthread in tests on FreeBSD
llvm-svn: 227240
2015-01-27 20:43:53 +00:00
Nico Weber b1e72eca0c [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

llvm-svn: 227226
2015-01-27 19:27:39 +00:00
Eric Fiselier 8e0dec7c80 Adopt CMake policy CMP0042. Set MACOSX_RPATH on by default.
llvm-svn: 227139
2015-01-26 21:56:45 +00:00
Marshall Clow 00f792e19e Added test for incomplete type support in vector/list/forward_list. References PR#17980
llvm-svn: 227131
2015-01-26 20:06:52 +00:00
Eric Fiselier 6ffc9bf6ba Change the available features used for no-rtti and no-exceptions
llvm-svn: 227107
2015-01-26 18:11:58 +00:00
Marshall Clow 07ef8e6796 Fix PR21428. Buffer was one byte too small in octal formatting case. Add test
llvm-svn: 227097
2015-01-26 17:24:52 +00:00
Eric Fiselier fbbfd09214 Get libc++ building on Sun Solaris. Patch from C Bergstrom.
llvm-svn: 226947
2015-01-23 22:22:36 +00:00
Filipe Cabecinhas 2d4e4ff77e Add USES_TERMINAL to libcxx lit tests, if available
llvm-svn: 226900
2015-01-23 06:59:51 +00:00
Marshall Clow f15d7a5882 Fix PR#22284. Add a new overload to deque::insert to handle forward iterators. Update tests to exercise this case.
llvm-svn: 226847
2015-01-22 18:33:29 +00:00
Eric Fiselier 74e82fa4f3 [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

llvm-svn: 226844
2015-01-22 18:05:58 +00:00
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
Eric Fiselier e75e0b4095 Move unconditional test compile and link flags into their configuration functions.
llvm-svn: 224674
2014-12-20 04:14:14 +00:00
Eric Fiselier a78a26783e [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

llvm-svn: 224671
2014-12-20 03:16:55 +00:00
Eric Fiselier 5a83710e37 Move test into test/std subdirectory.
llvm-svn: 224658
2014-12-20 01:40:03 +00:00
Eric Fiselier 5459af15f9 [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

llvm-svn: 224626
2014-12-19 22:21:44 +00:00
Eric Fiselier 7d8372ea02 Remove unneeded configuration code.
llvm-svn: 224618
2014-12-19 21:42:17 +00:00
Eric Fiselier 469a4f90bb [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

llvm-svn: 224603
2014-12-19 19:27:32 +00:00
Marshall Clow d60fe11919 Re-commit the test for regex that I busted last night - now passes under ASAN
llvm-svn: 224342
2014-12-16 16:22:43 +00:00
Justin Bogner 1e8019f5b9 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.

llvm-svn: 224317
2014-12-16 05:28:07 +00:00
Jonathan Roelofs ab534366fe Appease the c++14 buildbots
llvm-svn: 224304
2014-12-16 01:18:11 +00:00
Marshall Clow e8a651b02d Comment out the breaking tests until I figure out what's going on here.
llvm-svn: 224301
2014-12-16 00:59:59 +00:00
Jonathan Roelofs 075406fdc9 Fix installheaders target's permissions
llvm-svn: 224300
2014-12-16 00:48:13 +00:00
Marshall Clow b58f003e86 Once more w/o the typo.
llvm-svn: 224298
2014-12-16 00:46:23 +00:00
Marshall Clow 8a389a5786 Fix the literal string that I said would be six elements long to actually be six elements long. Octal. Sheesh.
llvm-svn: 224297
2014-12-16 00:45:47 +00:00
Marshall Clow 470a231b7c Add test to ensure that iterator_traits<NotAnIterator> doesn't have a value type
llvm-svn: 224295
2014-12-16 00:30:07 +00:00