Commit Graph

1951 Commits

Author SHA1 Message Date
Eric Fiselier 5e1c9ae34f Fix DYNLD_LIBRARY_PATH to include the ABI path if specified
llvm-svn: 232527
2015-03-17 19:37:26 +00:00
Jonathan Roelofs f0d7c16d68 Fix failed test command repro printing for *.pass.cpp tests
Before we were printing out the compile command twice, which isn't that useful.

Thanks EricWF for the report!

llvm-svn: 232526
2015-03-17 19:32:24 +00:00
Ed Schouten d2647eaae6 Clean up iostream creation in preparation for conditionalizing streams.
Interleave the code for narrow and wide character streams. This makes it
more obvious that the two pieces of code are identical. Furthermore, it
makes it easier to conditionally compile support for certain streams, as
less #ifdef blocks are needed.

Differential Revision:	http://reviews.llvm.org/D8342
Reviewed by:	marshall

llvm-svn: 232516
2015-03-17 18:40:58 +00:00
Eric Fiselier ea10d2477a [libcxx] Add <experimental/tuple> header for LFTS.
Summary:
This patch adds the `<experimental/tuple>` header (almost) as specified in the latest draft of the library fundamentals TS.

The main changes in this patch are:

1. Added variable template `tuple_size_v`
2. Added function `apply(Func &&, Tuple &&)`.
3. Changed `__invoke` to be `_LIBCPP_CONSTEXPR_AFTER_CXX11`.

The `apply(...)` implementation uses `__invoke` to invoke the given function. `__invoke` already provides the required functionality. Using `__invoke` also allows `apply` to be used on pointers to member function/objects as an extension. In order to facilitate this `__invoke` has to be marked `constexpr`. 



Test Plan:
Each new feature was tested. 

The test cases for `tuple_size_v` are as follows:
1. tuple_size_v.pass.cpp
  - Check `tuple_size_v` on cv qualified tuples, pairs and arrays.
2. tuple_size_v.fail.cpp
  - Test on reference type.
3. tuple_size_v_2.fail.cpp
  - Test on non-tuple
4. tuple_size_v_3.fail.cpp
  - Test on pointer type.

The test cases for tuple.apply are as follows:

1. arg_type.pass.cpp
   - Ensure that ref/pointer/cv qualified types are properly passed.
2. constexpr_types.pass.cpp
   - Ensure constexpr evaluation of apply is possible for `tuple` and `pair`.
3. extended_types.pass.cpp
   - Test apply on function types permitted by extension.
4. large_arity.pass.cpp
   - Test that apply can evaluated on tuples and arrays with large sizes.
5. ref_qualifiers.pass.cpp
   - Test that apply respects ref qualified functions.
6. return_type.pass.cpp
   - Test that apply returns the proper type.
7. types.pass.cpp
   - Test apply on function types as required by LFTS.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 232515
2015-03-17 18:28:14 +00:00
Marshall Clow 2d832d2429 Define a new macro: _LIBCPP_HAS_NO_VARIABLE_TEMPLATES and use it. No functionality change.
llvm-svn: 232493
2015-03-17 15:30:22 +00:00
Eric Fiselier 57f00f2f9c [libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block.
Summary:
There is no reason to guard `tuple_size`, `tuple_element` and `get<I>(...)` for pair and array inside of `<__tuple>` so that they are only available when we have variadic templates.
This requires there be redundant declarations and definitions. It also makes it easy to get things wrong.

For example the following code should compile (and does in c++11).
```
#define _LIBCPP_HAS_NO_VARIADICS
#include <array>

int main()
{
  static_assert((std::tuple_size<std::array<int, 10> volatile>::value == 10), "");
}
```

This patch lifts the non-variadic parts of `tuple_size`, `tuple_types`, and `get<I>(...)` to the top of `<__tuple>` where they don't require variadic templates. This patch also removes `<__tuple_03>` because there is no longer a need for it.


Reviewers: danalbert, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 232492
2015-03-17 15:08:03 +00:00
Ed Schouten 152b637682 Don't attempt to validate the output of %p.
In one of the ostream tests we attempt to validate whether the output of
%p is correct. This is actually outside the scope of libc++, for the
%reason that the format of %p is implementation defined. Change the test
%to validate that the output of %p is non-empty and is different when
%given two unequal addresses.

Differential Revision:	http://reviews.llvm.org/D8354
Reviewed by:	marshall

llvm-svn: 232390
2015-03-16 17:56:04 +00:00
Marshall Clow b7361983d1 Fix a problem when calling throw_with_nested with a class marked 'final'. Thanks to STL @ Microsoft for the bug report.
llvm-svn: 232384
2015-03-16 15:10:28 +00:00
Ed Schouten f424990d37 Don't hardcode the Czech locale name.
We already have a definition for the Czech locale name in
platform_support.h. Use this one instead.

While there, respect the common format of the tests. For most other
tests it's the case that test_iterators.h is placed right underneath the
other #includes (without an empty line). platform_support.h is included
after an empty line.

llvm-svn: 232383
2015-03-16 15:09:15 +00:00
Ed Schouten 74bbf7c7ee Make *abs() and *div() work on CloudABI.
According to POSIX, *abs() and *div() are allowed to be macros (in
addition to being functions). Make sure we undefine these, so that
std::*abs() and std::*div() work as expected.

llvm-svn: 232379
2015-03-16 14:27:44 +00:00
Ed Schouten bd250daee0 Don't hardcode the locale name string.
The rest of the test uses the #defines for the locale names properly. In
this single spot we do hardcode the string. This causes this test to
fail on CloudABI, where this locale is called en_US.UTF-8@UTC.

llvm-svn: 232365
2015-03-16 09:44:37 +00:00
Ed Schouten 69722ab7c1 Remove unneeded initialisation of fenv_t and fexcept_t.
Though common, there is no requirement that fenv_t and fexcept_t are
structure and integer types, respectively. fexcept_t is a structure on
CloudABI.

llvm-svn: 232329
2015-03-15 18:36:31 +00:00
Jonathan Roelofs f11625d131 Fix build break on Solaris introduced by r231940
Solaris apparently doesn't have iswblank_l.


Thanks to C Bergstrom for the report!

llvm-svn: 232172
2015-03-13 15:09:42 +00:00
Renato Golin 2481cea17c Update copyright year to 2015.
llvm-svn: 232094
2015-03-12 20:13:11 +00:00
Ed Schouten 637a6862d6 Also enable the default rune table on CloudABI.
CloudABI does not expose a table on its own.

llvm-svn: 232050
2015-03-12 15:48:06 +00:00
Ed Schouten 97fdea618e Add option to disable access to the global filesystem namespace.
Systems like FreeBSD's Capsicum and Nuxi CloudABI apply the concept of
capability-based security on the way processes can interact with the
filesystem API. It is no longer possible to interact with the VFS
through calls like open(), unlink(), rename(), etc. Instead, processes
are only allowed to interact with files and directories to which they
have been granted access. The *at() functions can be used for this
purpose.

This change adds a new config switch called
_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE. If set, all functionality
that requires the global filesystem namespace will be disabled. More
concretely:

- fstream's open() function will be removed.
- cstdio will no longer pull in fopen(), rename(), etc.
- The test suite's get_temp_file_name() will be removed. This will cause
  all tests that use the global filesystem namespace to break, but will
  at least make all the other tests run (as get_temp_file_name will not
  build anyway).

It is important to mention that this change will make fstream rather
useless on those systems for now. Still, I'd rather not have fstream
disabled entirely, as it is of course possible to come up with an
extension for fstream that would allow access to local filesystem
namespaces (e.g., by adding an openat() member function).

Differential revision:	http://reviews.llvm.org/D8194
Reviewed by:		jroelofs (thanks!)

llvm-svn: 232049
2015-03-12 15:44:39 +00:00
Jonathan Roelofs 29f342c6b5 Fix ctype_byname<wchar_t>::do_is() mask checking.... again
This basically reverts the revert in r216508, and fixes a few more cases while
I'm at it. Reading my commit message on that commit again, I think it's bupkis.

http://reviews.llvm.org/D8237

llvm-svn: 231940
2015-03-11 17:00:28 +00:00
Ed Schouten 12e0126596 Disable cat*() on CloudABI. Also make tiny cleanups.
On a new platform that I am working on
(https://github.com/NuxiNL/cloudlibc) I am not implementing the
cat{open,close,gets}() API, just like Android, Newlib, etc.

Instead of adding yet another operating system name to the #ifs,
introduce _LIBCPP_HAS_CATOPEN in include/__config. Also adjust the code
to only pull in nl_types.h when _LIBCPP_HAS_CATOPEN is set. We only
needed this header for the cat*() API.

Differential Revision:	http://reviews.llvm.org/D8163
Reviewed by:	marshall

llvm-svn: 231937
2015-03-11 16:39:36 +00:00
Dan Albert 900086de88 Move Android to the builtin rune table.
llvm-svn: 231897
2015-03-11 00:51:06 +00:00
Dan Albert 6846b2661d Copy data files to the remote runner.
Summary:
The data files for any given test will be in the same directory as the
source with a file name that matches *.dat. To make these available to
tests running remotely (such as over adb or ssh), copy them into the
test's remote working directory.

Note that we will perform more copies than we actually need. The data
files in the directory may only be used by one of the tests, but will
be copied for all tests in the same directory.

This patch also moves the remote test binary into the working
directory (previously it was only invoked from the working directory
rather than existing in it).

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 231864
2015-03-10 22:31:49 +00:00
Eric Fiselier 4b7533a1dd Use generic feature name for sanitizers that replace new and delete
llvm-svn: 231841
2015-03-10 20:46:04 +00:00
Dan Albert ec571f2060 Factor out RemoteExecutor from SSHExecutor.
Summary:
A lot of the pieces of SSHExecutor can be shared with my AdbExecutor
(https://android-review.googlesource.com/#/c/138807/).

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 231815
2015-03-10 18:43:16 +00:00
Ed Schouten 911040f19e Also use LC_C_LOCALE on CloudABI.
Before I discovered that NetBSD provides a permanent handle to the C
locale called LC_C_LOCALE, I also added support for this to CloudABI
under the name LC_POSIX_LOCALE. I've renamed it to LC_C_LOCALE to
improve compatibility.

llvm-svn: 231780
2015-03-10 09:35:22 +00:00
Ed Schouten 510b6ab07c Enable _LIBCPP_LOCALE__L_EXTENSIONS on CloudABI.
CloudABI provides the _l() functions that are part of POSIX.1-2008, but
also the extensions that are available on systems like OS X and *BSD
(scanf_l, printf_l, etc).

llvm-svn: 231777
2015-03-10 09:26:38 +00:00
Ed Schouten cda27e8197 Don't include <sys/sysctl.h> on CloudABI.
As CloudABI does not provide sysctl(), this header is not present. Make
thread.cpp build correctly (and pass all tests) by not including the header.

llvm-svn: 231768
2015-03-10 08:01:10 +00:00
Ed Schouten c19393c758 Print log/error messages on stderr, not stdout
There are a couple of places where libc++ prints log/error messages to
stdout on its own. This may of course interfere with the output
generated with applications. Log/error messages should be directed to
stderr instead.

Differential Revision:	http://reviews.llvm.org/D8135
Reviewed by:	marshall

llvm-svn: 231767
2015-03-10 07:57:43 +00:00
Ed Schouten 17f5dbef9b 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

llvm-svn: 231764
2015-03-10 07:46:06 +00:00
Eric Fiselier 21d7ffa233 [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

llvm-svn: 231729
2015-03-10 00:25:20 +00:00
Dimitry Andric a3175bab88 Fix another -Wunused-local-typedef warning in include/__tree.
The _Pp typedef in __tree<_Tp, _Compare, _Allocator>::__count_multi()
isn't used anywhere, so adding _LIBCPP_UNUSED is unecessary.

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

llvm-svn: 231705
2015-03-09 21:39:02 +00:00
Eric Fiselier 764d030840 Move test to use correct suffix
llvm-svn: 231704
2015-03-09 21:30:48 +00:00
Eric Fiselier 66e41b66ad Add TrackedValue to test/support. Thanks to Louis Dionne
llvm-svn: 231674
2015-03-09 18:02:16 +00:00
Marshall Clow f4903afd93 Fix an exception-safety bug in <deque>. Reference: PR#22650. Not closing the bug because there's more work to do here
llvm-svn: 231672
2015-03-09 17:08:51 +00:00
Ed Schouten 1d2c052e9f 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.

llvm-svn: 231649
2015-03-09 12:04:16 +00:00
Dan Albert eafe55200c 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.

llvm-svn: 231498
2015-03-06 18:51:25 +00:00
Dan Albert ebfe1fe059 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.

llvm-svn: 231496
2015-03-06 18:35:45 +00:00
Eric Fiselier e105ea84a2 Remove unneeded python import
llvm-svn: 231453
2015-03-06 06:22:22 +00:00
Eric Fiselier 26aaa6872d Run ShTests when the executor is an instance of LocalExecutor
llvm-svn: 231404
2015-03-05 20:27:01 +00:00
Marshall Clow 10b33a2662 Rework reverse_iterator::operator[] so as not to use the base iterators operator [], which can cause constness problems. Fixes PR17883
llvm-svn: 231375
2015-03-05 16:07:37 +00:00
Marshall Clow b844b1a0ff Move the <dynarray> tests out of the std/ hierarchy, since it's not really part of the standard any more.
llvm-svn: 231311
2015-03-04 23:09:15 +00:00
Marshall Clow 7945c8a1bb Nbjoerg suggested a better name for the macro for the default rune table: _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
llvm-svn: 231255
2015-03-04 16:50:02 +00:00
Marshall Clow 66599d8ea8 Create a default rune table for libc++. Initial setting - never enabled. The expectation is that some targets (Android, cough) will enable it. Note that this is an implementation detail, not an interface change.
llvm-svn: 231252
2015-03-04 16:10:14 +00:00
Eric Fiselier b3be398c67 Allow declaration of map and multimap iterator with incomplete mapped type. Patch from eugenis
llvm-svn: 231119
2015-03-03 20:10:01 +00:00
Marshall Clow af670e4b37 Add better tests for ctype<char>::classic_table
llvm-svn: 231077
2015-03-03 16:15:26 +00:00
Eric Fiselier 0357171f1c [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

llvm-svn: 231076
2015-03-03 15:59:51 +00:00
Saleem Abdulrasool 66d4c6e78c cmath: account for MSVCRT 12.0 changes
MSVCRT 12.0 introduces better compatibility for C99. This includes a number of
math routines that were previously undefined. Use the crtversion.h header to
detect the version of MSVCRT being targeted and avoid re-declaring the
variables.

Since copysign has been introduced in MSVCRT, importing the definition via using
makes it difficult to provide overloads (due to minor differences between
throw () and noexcept. Avoid defining the overloads on newer MSVCRT
targets.

llvm-svn: 230867
2015-02-28 20:18:39 +00:00
Jonathan Roelofs 724d38e448 Add self to CREDITS.txt
llvm-svn: 230595
2015-02-26 00:48:22 +00:00
Jonathan Roelofs 49ff203ec4 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

llvm-svn: 230592
2015-02-26 00:42:17 +00:00
JF Bastien e9401f61c2 libc++: support newlib's ctype
Summary: Newlib supports ctype differently from other platforms, this patch teaches libc++ about yet another platform that does ctype differently.

Reviewers: jroelofs

Subscribers: cfe-commits, danalbert, EricWF, jvoung, jfb, mclow.lists

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

llvm-svn: 230557
2015-02-25 22:16:46 +00:00
Marshall Clow a64f2fbc09 Add trailing return types (and noexcept specifications) to the 'diamond operators'. Fixes PR#22600.
llvm-svn: 230484
2015-02-25 12:20:52 +00:00
Marshall Clow f6d58a2a1f Make the forward declaration for array swap have the same inline/visibility attributes as the definition. Thanks to Steven Wu for the catch.
llvm-svn: 230330
2015-02-24 12:46:39 +00:00
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