[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



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277461 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed