summaryrefslogtreecommitdiffstats
path: root/libcxx/test/atomics
Commit message (Collapse)AuthorAgeFilesLines
* Move a test to the new tests directory.Dan Albert2015-01-061-43/+0
| | | | | | | 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
* Make a test UNSUPPORTED if libcpp-has-no-threads.Dan Albert2015-01-061-0/+2
| | | | llvm-svn: 225287
* Appease MSAN buildbots.Dan Albert2015-01-061-1/+1
| | | | | | | This is just a compile time test, but we have MSAN buildbots that will fail since `exp` was uninitialized. llvm-svn: 225286
* Obey [atomics.types.operations.req]/21 for GCC.Dan Albert2015-01-061-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Move test into test/std subdirectory.Eric Fiselier2014-12-2056-3488/+0
| | | | llvm-svn: 224658
* Mark a couple of tests as XFAIL with older compilers.Eric Fiselier2014-12-071-0/+4
| | | | llvm-svn: 223600
* Test that the single-threaded lit feature is available iff the corresponding ↵Jonathan Roelofs2014-10-271-0/+18
| | | | | | | | guard is #defined http://reviews.llvm.org/D6006 llvm-svn: 220729
* Add test to ensure including <atomic> fails when _LIBCPP_HAS_NO_THREADS is ↵Eric Fiselier2014-10-271-0/+23
| | | | | | defined. llvm-svn: 220722
* Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie.Eric Fiselier2014-10-191-0/+3
| | | | llvm-svn: 220154
* Whitespace maintenance. Remove a bunch of tabs that snuck in. No ↵Marshall Clow2014-10-182-15/+15
| | | | | | functionality change llvm-svn: 220142
* PR20546: Fix tests for compare_exchange_weak.Dan Albert2014-09-065-18/+28
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow libc++ to be built on systems without POSIX threadsJonathan Roelofs2014-09-0543-0/+102
| | | | | | | | | | 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 llvm-svn: 217271
* Mark test types for <atomic> nothrow default constructible. Patch from Steve ↵Eric Fiselier2014-08-2715-15/+15
| | | | | | | | | | | | | 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. llvm-svn: 216561
* Add test cases for creating atomic types for trivially copyable types.Marshall Clow2014-07-312-0/+141
| | | | llvm-svn: 214406
* Stephan Tolksdorf: fixes the issue in the <atomic> header and adds ↵Howard Hinnant2013-05-025-4/+37
| | | | | | | | corresponding tests. I've used macros to fall back to a user-provided default constructor if _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS (though I suspect that there won't be many users defining that macro). The tests use placement new to check that atomic values get properly zero-initialized. I had to modify the atomic_is_lock_free test, because default initialization of an object of const type 'const A' (aka 'const atomic<int>') requires a user-provided default constructor. llvm-svn: 180945
* atomic_bool was missing (just a typedef to atomic<bool>).Howard Hinnant2013-01-041-0/+57
| | | | llvm-svn: 171498
* libc++: Add some missing #includes to atomics tests. libc++ doesn't need theseRichard Smith2012-04-1924-0/+24
| | | | | | | at the moment, but they allow these tests to be used to test clang against libstdc++. Add myself to the credits file, as suggested by Howard. llvm-svn: 155085
* Fix the remaining atomic tests, all of which were wrong for the case where aDavid Chisnall2012-04-057-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compare-and-exchange failed (it should update the expected value to the current value, and the tests were checking that it didn't...). Results of the atomics part of the test suite on FreeBSD with clang trunk and the atomic.c from compiler-rt (currently kludged into the test, not installed properly): **************************************************** Results for /root/libc++/test/atomics: using clang version 3.1 (trunk 153415) Target: x86_64-unknown-freebsd10.0 Thread model: posix with -std=c++0x -stdlib=libc++ -pthread /tmp/atomic.o ---------------------------------------------------- sections without tests : 0 sections with failures : 0 sections without failures: 14 + ---- total number of sections : 14 ---------------------------------------------------- number of tests failed : 0 number of tests passed : 52 + ---- total number of tests : 52 **************************************************** Yay! llvm-svn: 154095
* Fix test cases that were trying to make atomic things that are not trivially ↵David Chisnall2012-04-0511-44/+0
| | | | | | | | copyable. Now all of the test cases compile. Some of them even run! llvm-svn: 154094
* After a long break to wait for the atomic spec to settle, this completes the ↵Howard Hinnant2010-12-0811-0/+288
| | | | | | library part of <atomic>. It currently won't even parse as it depends on the existence of the intrinsics specified at http://libcxx.llvm.org/atomic_design_a.html. Everything has been tested using fake intrinsics which have now been removed. As the intrinsics come online, the ATOMIC_* macros will need to be adjusted to reflect which operations are lock-free. These macros will probably need to be #ifdef'd for each supported platform. llvm-svn: 121267
* atomics ...Howard Hinnant2010-12-077-748/+480
| | | | llvm-svn: 121202
* Work on <atomic> continues. The file size is actually sane now...Howard Hinnant2010-12-0710-0/+809
| | | | llvm-svn: 121181
* Getting <atomic> warmed back up. We have a hopefully more stable spec now. ↵Howard Hinnant2010-12-0612-0/+928
| | | | | | And I believe the intrinsic spec at http://libcxx.llvm.org/atomic_design_a.html is still good. llvm-svn: 121064
* Update testsuite strucuture to latest draftHoward Hinnant2010-11-234-748/+0
| | | | llvm-svn: 120045
* Update testsuite strucuture to latest draftHoward Hinnant2010-11-234-0/+748
| | | | llvm-svn: 120043
* Update testsuite strucuture to latest draftHoward Hinnant2010-11-234-0/+0
| | | | llvm-svn: 120040
* license changeHoward Hinnant2010-11-1620-40/+40
| | | | llvm-svn: 119395
* [atomics.types.address]Howard Hinnant2010-10-211-0/+220
| | | | llvm-svn: 117033
* atomic_schar, atomic_uchar, atomic_short, atomic_ushort, atomic_int, ↵Howard Hinnant2010-10-191-2/+64
| | | | | | atomic_uint, atomic_long, atomic_ulong, atomic_llong, atomic_ullong, atomic_char16_t, atomic_char32_t and atomic_wchar_t. llvm-svn: 116860
* atomic_charHoward Hinnant2010-10-192-0/+453
| | | | llvm-svn: 116813
* Still working on the basic design of <atomic>. I'm working towards a system ↵Howard Hinnant2010-10-042-24/+0
| | | | | | by which the compiler only needs to define the strongest intrinsics it can. Weaker atomics in the library automatically try stronger and stronger variants, picking the weakest compiler intrinsic available. If no compiler intrinsics are available for a given operation, the library locks a mutex and does the job. Better documentation to follow... llvm-svn: 115538
* [atomics.flag] completed. Initialization is not working on clang and can't ↵Howard Hinnant2010-09-3011-3/+514
| | | | | | be made to work without defaulted default constructors. llvm-svn: 115207
* Contemplating this <atomic> reorganization...Howard Hinnant2010-09-291-1/+1
| | | | llvm-svn: 115087
* Didn't mean to commit that oneHoward Hinnant2010-09-291-275/+0
| | | | llvm-svn: 115058
* Wrestling with the slowly dawning realization that <atomic> isn't ↵Howard Hinnant2010-09-293-0/+313
| | | | | | implementable on any compiler at my disposal... llvm-svn: 115054
* fixing whitespaceHoward Hinnant2010-09-282-2/+2
| | | | llvm-svn: 114967
* [atomics.order]Howard Hinnant2010-09-284-0/+78
| | | | llvm-svn: 114966
* Getting started on <atomic>Howard Hinnant2010-09-271-0/+20
llvm-svn: 114887
OpenPOWER on IntegriCloud