hanchenye-llvm-project/libcxx/test
Dan Albert 0bb696800f 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

llvm-svn: 217319
2014-09-06 20:38:25 +00:00
..
algorithms Fix PR#202520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm 2014-08-04 17:32:25 +00:00
atomics PR20546: Fix tests for compare_exchange_weak. 2014-09-06 20:38:25 +00:00
containers [asan] Make vector asan annotations exception-friendly 2014-09-02 23:43:38 +00:00
depr fix stdio.h test to reflect removal of ::gets in c++14 2014-08-10 22:39:11 +00:00
diagnostics Linux: Correctly identify valid error codes 2014-05-29 05:02:22 +00:00
experimental [libcxx] expose experimental::erased_type for all standard versions. 2014-07-24 19:17:38 +00:00
extensions Do not derive __gnu_cxx::hash<T> from std::hash<T>. 2014-03-06 04:11:10 +00:00
input.output Fix assignments that should be comparisons x3 2014-08-23 07:55:29 +00:00
iterators Implement LWG 2360: 'reverse_iterator::operator*() is unimplementable'. Note that this is a (small) behavior change in the library. Reverse iterators whose base iterators' operator* return references to 'within themselves' have been sacrificed to the greater goal of avoiding data races. 2014-03-11 17:16:17 +00:00
language.support Fix numeric_limits<XXX>::is_modulo for signed arithmetic types. We were reporting true, for all arithmetic types, which is incorrect. Fix the tests which were wrong, too. This fixes PR#20158. 2014-07-31 01:18:05 +00:00
localization Mark some localization time tests as XFAIL on linux. 2014-08-21 02:38:21 +00:00
numerics Fix buffer overflow issue in valarray test 2014-09-03 05:47:35 +00:00
re Add locales to available_features for tests. 2014-08-04 18:44:48 +00:00
strings Mark cuchar tests as always xfail since we don't provide the header' 2014-08-18 05:09:51 +00:00
support PR20546: Fix tests for compare_exchange_weak. 2014-09-06 20:38:25 +00:00
thread Allow libc++ to be built on systems without POSIX threads 2014-09-05 19:45:05 +00:00
utilities Allow libc++ to be built on systems without POSIX threads 2014-09-05 19:45:05 +00:00
CMakeLists.txt [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default LIT args. 2014-08-23 04:33:20 +00:00
lit.cfg Bugfix: allow additional_features to be empty 2014-09-05 19:03:46 +00:00
lit.site.cfg.in [libcxx] Add support for LLVM_USE_SANITIZER to libcxx when being built standalone and in-tree 2014-08-18 05:03:46 +00:00
nothing_to_do.pass.cpp Test commit: Reverting whitespace changes 2014-07-17 05:10:03 +00:00
testit Apply patch for Albert Wong: 'Modify testit to allow filtering tests by prefixes'. 2014-01-15 16:28:42 +00:00