This is an archive of the discontinued LLVM Phabricator instance.

tsan: add another test for atomics
ClosedPublic

Authored by dvyukov on Jul 29 2021, 3:56 AM.

Details

Summary

Add a test where atomic-release happens while
another thread spins calling load-acquire.
This can expose some interesting interleavings
of release and acquire.

Diff Detail

Event Timeline

dvyukov created this revision.Jul 29 2021, 3:56 AM
dvyukov requested review of this revision.Jul 29 2021, 3:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2021, 3:56 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Jul 29 2021, 7:04 AM
melver added inline comments.
compiler-rt/test/tsan/atomic_norace2.cpp
40

weak==true: can this fail spuriously on some arch and the test then fails?

This revision is now accepted and ready to land.Jul 29 2021, 7:04 AM
dvyukov updated this revision to Diff 362776.Jul 29 2021, 7:42 AM

use strong compare_exchange

dvyukov marked an inline comment as done.Jul 29 2021, 7:42 AM
dvyukov added inline comments.
compiler-rt/test/tsan/atomic_norace2.cpp
40

good catch

This revision was landed with ongoing or failed builds.Jul 29 2021, 7:43 AM
This revision was automatically updated to reflect the committed changes.
dvyukov marked an inline comment as done.