summaryrefslogtreecommitdiffstats
path: root/libcxx/benchmarks/ContainerBenchmarks.hpp
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2016-08-01 19:27:08 +0000
committerJF Bastien <jfb@google.com>2016-08-01 19:27:08 +0000
commita2b1c14911d042b4a2c0b9b8d78f804f12d2e434 (patch)
tree94b0b142716e7091a6d07d1d5b1099793ea1ffba /libcxx/benchmarks/ContainerBenchmarks.hpp
parent755220bcefcf90ebbcc54f03392a809d84d64146 (diff)
downloadbcm5719-llvm-a2b1c14911d042b4a2c0b9b8d78f804f12d2e434.tar.gz
bcm5719-llvm-a2b1c14911d042b4a2c0b9b8d78f804f12d2e434.zip
libc++: test lock-free atomic alignment
Summary: libc++ implements std::atomic<_Tp> using __atomic_base<_Tp> with `mutable _Atomic(_Tp) __a_`. That member must be suitably aligned on relevant ISAs for instructions such as cmpxchg to work properly, but this alignment isn't checked anywhere. __atomic_base's implementation relies on _Atomic doing "the right thing" since it's under the compiler's control, and only the compiler knows about lock-freedom and instruction generation. This test makes sure that the compiler isn't breaking libc++'s expectations. I'm looking at a few odd things in the C++ standard, and will have a few other fixes around this area in the future. This requires building with `-DLIBCXX_HAS_ATOMIC_LIB=True`, the test marks the dependency as REQUIRES and won't be run without. Reviewers: cfe-commits Subscribers: EricWF, mclow.lists Differential Revision: http://reviews.llvm.org/D22073 llvm-svn: 277368
Diffstat (limited to 'libcxx/benchmarks/ContainerBenchmarks.hpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud