This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Fix the behavior of OSAtomicTestAndClear
ClosedPublic

Authored by kubamracek on Aug 2 2016, 7:18 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 66471.Aug 2 2016, 7:18 AM
kubamracek retitled this revision from to [tsan] Fix the behavior of OSAtomicTestAndClear.
kubamracek updated this object.
kubamracek added a reviewer: dvyukov.
kubamracek added a project: Restricted Project.
kubamracek added subscribers: llvm-commits, zaks.anna.
dvyukov accepted this revision.Aug 2 2016, 7:33 AM
dvyukov edited edge metadata.
dvyukov added inline comments.
lib/tsan/rtl/tsan_interceptors_mac.cc
126 ↗(On Diff #66471)

This is now bit rather than bit_index.

This revision is now accepted and ready to land.Aug 2 2016, 7:33 AM
This revision was automatically updated to reflect the committed changes.