[tsan] Fix the behavior of OSAtomicTestAndClear
authorKuba Brecka <kuba.brecka@gmail.com>
Tue, 2 Aug 2016 14:30:52 +0000 (14:30 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Tue, 2 Aug 2016 14:30:52 +0000 (14:30 +0000)
commit3a748d60670c5dc81572ea680804b3e3486c20e0
tree4d6511543cdd00f7f0297d7f0499885641237a56
parent58f562887b10edc60f43fde6fdefab592e5c8aac
[tsan] Fix the behavior of OSAtomicTestAndClear

The system implementation of OSAtomicTestAndClear returns the original bit, but the TSan interceptor has a bug which always returns zero from the function. This patch fixes this and adds a test.

Differential Revision: https://reviews.llvm.org/D23061

llvm-svn: 277461
compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cc
compiler-rt/test/tsan/Darwin/osatomics-bitops.mm [new file with mode: 0644]