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
Loading
Please register or sign in to comment