hanchenye-llvm-project/libcxx
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
..
cmake [libcxx] Add support for LLVM_USE_SANITIZER to libcxx when being built standalone and in-tree 2014-08-18 05:03:46 +00:00
include Address some post-commit review comments on r217261 2014-09-05 20:28:44 +00:00
lib [libc++] Fix the CMake build on Mac when setting MACOSX_DEPLOYMENT_TARGET=10.6 2014-08-12 17:32:07 +00:00
src Address some post-commit review comments on r217261 2014-09-05 20:28:44 +00:00
test PR20546: Fix tests for compare_exchange_weak. 2014-09-06 20:38:25 +00:00
www Update linux test results 2014-08-18 06:53:30 +00:00
.arcconfig Update Arcanist config to point to reviews.llvm.org 2014-06-10 18:29:36 +00:00
CMakeLists.txt [libcxx] Add support for LLVM_USE_SANITIZER to libcxx when being built standalone and in-tree 2014-08-18 05:03:46 +00:00
CREDITS.TXT Add self to credits 2014-08-21 04:21:43 +00:00
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
Makefile Exclude .svn (and other "dot" directories) when installing headers. 2014-03-13 16:13:54 +00:00