Commit Graph

686 Commits

Author SHA1 Message Date
Dan Albert
7ba3c57565 PR20546: Fix tests for compare_exchange_weak.
These calls are allowed to fail spuriously.

29.6.5.25:

    Remark: A weak compare-and-exchange operation may fail spuriously.
    That is, even when the contents of memory referred to by expected
    and object are equal, it may return false and store back to expected
    the same memory contents that were originally there. [ Note: This
    spurious failure enables implementation of compare and-exchange on a
    broader class of machines, e.g., load-locked store-conditional
    machines. A consequence of spurious failure is that nearly all uses
    of weak compare-and-exchange will be in a loop.

To fix this, we replace any assert() that expects
std::atomic::compare_exchange_weak() to return true with a loop. If the
call does not return true within N runs (with N currently equal to 10),
then the test fails.

http://llvm.org/bugs/show_bug.cgi?id=20546


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-06 20:38:25 +00:00
Jonathan Roelofs
8d86b2e686 Allow libc++ to be built on systems without POSIX threads
If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.

http://reviews.llvm.org/D3969


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217271 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 19:45:05 +00:00
Jonathan Roelofs
d634a2c404 Bugfix: allow additional_features to be empty
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217268 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 19:03:46 +00:00
Jonathan Roelofs
217bdc189a Set -D_LIBCPP_HAS_NO_THREADS and -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK based on available_features
http://reviews.llvm.org/D5214


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217261 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-05 17:21:57 +00:00
Justin Bogner
464da3b76c test: Make it possible to opt in to use_clang_verify per test
This modifies the use_clang_verify parameter I added in r217009 to
only apply to tests that specifically ask for it via // USE_VERIFY.
This allows us to incrementally convert tests, but start enjoying the
benefits right away.

Suggested by Eric Fiselier in code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 06:01:52 +00:00
Eric Fiselier
438d2cb25d Fix buffer overflow issue in valarray test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 05:47:35 +00:00
Justin Bogner
837cfe50fe test: Allow using clang -verify for failures rather than exit 1
Currently, failure tests work by checking that compilation exits 1.
This can lead to tests that fail for the wrong reason, so it'd be
preferable to convert them to check for specific errors.

This adds use_clang_verify parameter that runs failure tests using
clang's -verify flag. I'll convert some tests in subsequent commits,
and once all of the tests are converted we should key this on whether
cxx_under_test is clang.

I've also converted one of the unique.ptr tests, since it's the one
that motivated the idea of using clang -verify when possible in the
review of r216317.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217009 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 04:32:08 +00:00
Kostya Serebryany
497f912ab2 [asan] Make vector asan annotations exception-friendly
Fix vector asan annotations with RAII.
Add a test.
Also, remove one dead function.
Review: http://reviews.llvm.org/D4170



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216995 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 23:43:38 +00:00
Jonathan Roelofs
c5780651c3 Partially address a FIXME in steady_clock::now()
http://reviews.llvm.org/D4045


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216949 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 21:14:38 +00:00
Marshall Clow
e33e03e558 Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216909 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 16:19:38 +00:00
Eric Fiselier
b26c966174 Mark test types for <atomic> nothrow default constructible. Patch from Steve MacKenzie.
The way the standard currently specifies the default constructor for atomic<T>
requires T to be nothrow default constructible. This patch makes our test types
meet this requirement.

Note: The nothrow default constructible requirment is subject to the outcome of
LWG issue 1265.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 17:00:11 +00:00
Marshall Clow
4de32048f5 Fix bug 20740 - std::set/std::map don't support heterogeneous lookup for count(). Thanks to Jim Porter for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216353 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 23:54:16 +00:00
Eric Fiselier
a564dc53dd Fix assignments that should be comparisons x3
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 07:55:29 +00:00
Eric Fiselier
69e7c05783 Add return statement to a test class's assignment operator. Defect found by Coverity Scan.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 06:36:11 +00:00
Eric Fiselier
1070916643 [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default LIT args.
Summary:
In order to gather more information about testsuite results these flags should be added to LIT's default args.
These new switches were recently added to LIT. It been more than two weeks since both switches were added.
I think its time we add these to our LIT flags.


Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216315 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 04:33:20 +00:00
Eric Fiselier
ae6e58c561 Fix handling of format strings to work with python 2.6
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 04:02:21 +00:00
Dan Albert
2c26213103 Refactor lit.cfg.
The purely imperative format of the configuration performed in lit.cfg
was making merge conflicts with changes I have for Android an
unbelievable pain in the ass. I've moved all of the configuration into a
Configuration class, with each piece of configuration happening in a
different method. This way I can avoid merge conflicts, and any new
features that get added (as have been done with the sanitizers, the -std
flag, etc.) can be easily applied to Android as well.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 17:30:44 +00:00
Eric Fiselier
501561910a Mark some localization time tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:38:21 +00:00
Eric Fiselier
51642a4e81 Mark some localization monetary tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:22:54 +00:00
Eric Fiselier
f523693f3f Mark localization ctype tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:03:01 +00:00
Eric Fiselier
682132b4cc fix missing include for ::close in platform_support.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 17:52:40 +00:00
Eric Fiselier
bc4bcf051b Add extra test case for PR20345. Should have been commited with r215984
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215985 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:33:05 +00:00
Eric Fiselier
63648cffc0 Fix is_member_function_pointer does not account for ellipsis. PR20345. Patch from Agustin Berge.
I reviewed the patch and added the test cases.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215984 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:31:47 +00:00
Jonathan Roelofs
6f10d47bbc Give libcxx tests temporary filenames that are actually unique.
This fixes a race condition on temp file name creation.

http://reviews.llvm.org/D4962


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215977 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 13:56:56 +00:00
Eric Fiselier
6661ad10f2 Add standard version to lit.cfg's available features
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 07:05:40 +00:00
Eric Fiselier
da98ce033e [libcxx] Add UNSUPPORTED tag to lit. It mirrors REQUIRES.
Summary:
This patch adds support for // UNSUPPORTED: feature. If an excluded feature is found in the list of available features then the test is marked unsupported.

I hope to use this to mark test unsupported if the fail with msan on asan. As well as tests that fail in particular standard modes.


Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215883 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 06:43:06 +00:00
Eric Fiselier
781448f48a Mark cuchar tests as always xfail since we don't provide the header'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215873 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 05:09:51 +00:00
Eric Fiselier
25a1516832 [libcxx] Add support for LLVM_USE_SANITIZER to libcxx when being built standalone and in-tree
Summary:
This patch adds support for LLVM_USE_SANITIZER when being built in-tree and standalone. 

This patch does the following things:
1. define the LLVM_USE_SANITIZER option to "" when being built standalone. This also helps show we support it.
2. Translate LLVM_USE_SANITIZER when standalone in a very similar way done in llvm/cmake/HandleLLVMOptions.cmake.
3. Add config.llvm_use_sanitizer to lit.site.cfg.in
4. Add code to translate config.llvm_use_sanitizer's value into the needed compile flags in lit.cfg.

Currently lit.cfg assumes that that the compiler supports '-fno-omit-frame-pointer' while CMakeLists.txt actually checks to see if its supported. We could pass this information to lit but I'm not sure its needed. 

Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215872 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 05:03:46 +00:00
Eric Fiselier
dfe5e72ed3 [libcxx] Update the way the -std= flag is chosen by CMake and LibcxxTestFormat
Summary:
This patch does two things:
CMake Update:
  - Add compiler flag checks for -std=c++11 and -std=c++1y and remove check for -std=c++0x.
  - Add configuration option LIBCXX_ENABLE_CXX1Y to prevent/allow -std=c++1y from being chosen as the std version. LIBCXX_ENABLE_CXX1Y is set to OFF by default.
  - if LIBCXX_ENABLE_CXX1Y is enabled then set LIBCXX_STD_VERSION to c++1y and fail if the compiler does not support -std=c++1y
  - If c++1y is not enabled then use c++11 and fail if the compiler does not support c++11.

Lit Update:
  - Update lit.site.cfg.in to capture LIBCXX_STD_VERSION information as config.std.
  - Remove mentions of has_cxx0X configuration option.
  - Check for `--param std=X' passed to lit on the command line.
  - Choose the std for the tests either from command line parameter or (if it doesn't exist) the lit.site.cfg.



Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: emaste, rnk, ajwong, danalbert, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215802 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-16 01:35:36 +00:00
Eric Fiselier
b4b32a02fa Readding FreeBSD support to lit.cfg. Patch from Pawel Worach.
Pawel has been using this patch on his buildbots for a while. This should
allow the testsuite to run on FreeBSD with libcxxrt.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 23:24:00 +00:00
Jonathan Roelofs
09d8c46f30 Tame a few enum size tests when using -fshort-enums on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215769 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 21:34:52 +00:00
Eric Fiselier
efefe8ba34 Revert get testsuite running on FreeBSD.
There is a similar patch up for review. I'll submit my changes via that.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215750 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 18:49:28 +00:00
Eric Fiselier
101e2f3e06 Get testsuite running on FreeBSD.
Add initial support for using LIT to run the tests on FreeBSD. 
More work may need to be done to add support for FreeBSD but this is a
good initial step.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 18:00:47 +00:00
Eric Fiselier
c808961618 Fix incorrect locale requirements in tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215694 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 05:02:05 +00:00
Eric Fiselier
31b9c44aa7 Add bare_allocator archetype that implements the minimal possible allocator interface.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215691 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 04:15:41 +00:00
Eric Fiselier
5b34a5f584 Change two tests to be less dependant on locales.
This patch removes the use of the "%c" specifier for getting/setting times.
The semantics of this specifier differ between linux and Mac. I don't believe
the use of this specifier was important to the test.

The following tests now pass on linux.
test/input.output/iostream.format/ext.manip/get_time.pass.cpp
test/input.output/iostream.format/ext.manip/put_time.pass.cpp

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215417 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 00:48:56 +00:00
Eric Fiselier
f4124610c2 Add return statement to slice_array and mask_array assignment. Closes PR20614.
This patch just adds the required return statements to slice_array::operator=
and mask_array::operator=.

Tests were added to check that the return value is the same as the object assigned
to.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 00:06:58 +00:00
Eric Fiselier
e48b0c40ad fix stdio.h test to reflect removal of ::gets in c++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215329 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-10 22:39:11 +00:00
David Blaikie
ddcbcd6b5e Revert "Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state."
Premature commit due to misreading CR feedback.

This reverts commit r215301.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 22:42:19 +00:00
David Blaikie
5eb396a8e6 Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state.
Some tests were constructing it with 0, so use -1 as the invalid state
instead.

Reviewers: Marshall Clow

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215301 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 22:35:47 +00:00
Eric Fiselier
ae39e4f795 fix copy and pasted comment in test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215276 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 02:43:16 +00:00
Eric Fiselier
2af66e9851 Mark math.h and cmath tests as xfail on linux.
These tests were marked as failing because the libc implementation does not
use the proper return type on certain math functions. There is other weirdness
that prevents us from defining our own version of these functions.

The failing tests in cmake were separated into their own files so that the rest
failures in the rest of the cmath tests were not hidden.

This was not done for the math.h test since we don't actually supply math.h


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215275 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 02:39:03 +00:00
Marshall Clow
095c3dd23e Apply a similar fix to <forward_list> as I did for <list> in r215210. Again, thanks to Ion Gaztañaga for noticing this problem w.r.t LWG#526
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215213 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 15:58:00 +00:00
Marshall Clow
fca038e133 While reading LWG#526, Ion Gaztañaga noticed that libc++ didn't correctly handle list::remove(const value_type &x), if x was an element of the list. Added a test for this, and a fix. Thanks to Ion for the report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 15:35:52 +00:00
Viktor Kutuzov
f2e8c04540 Fix re-building in-tree libc++ against in-tree libc++abi
Differential Revision: http://reviews.llvm.org/D4805


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 06:53:30 +00:00
Dan Albert
c09c2865b9 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214768 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 20:27:45 +00:00
Marshall Clow
529d303340 Fix a problem with reference_wrapper in C++03 that was causing counting predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214760 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 19:20:17 +00:00
Dan Albert
b4ed5ca01e Add locales to available_features for tests.
Linux has a lot of failures caused by not having support for certain
locales. Since these come out as a lot of noise in the test results,
have lit.cfg detect the presence of the various locales used in the
tests and add them to config.available_features as locale.LOCALE_NAME.

This patch also adds REQUIRES: locale.REQUIRED_LOCALE to every test that
I saw failing in this manner. We probably need to add more for all the
tests requiring en_US.UTF-8, but we can do that on an as-needed basis.

One thing that concerns me is how many tests get skipped because of
missing locales (especially in regex/). We should make a point of
splitting up any tests that test default behavior _and_ behavior under a
given locale so that we aren't losing coverage for default behavior.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 18:44:48 +00:00
Marshall Clow
f0f1bca861 Fix PR#202520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 17:32:25 +00:00
Eric Fiselier
d3d01eac01 Change lit.cfg to allow whitespace before comments
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 22:56:52 +00:00