This is an archive of the discontinued LLVM Phabricator instance.

[TSan][libdispatch] Port gcd-sync-block-copy.mm to C++
ClosedPublic

Authored by yln on Apr 12 2019, 3:34 PM.

Details

Summary

Apparently, it makes a difference on where a block lives depending on if
it's passed "inline" versus assigned and then passed via a variable.
Both tests in this commit now give a signal, if Block_copy is used in
dispatch_sync.

Since these tests use different mechanisms (Objective-C retain versus
C++ copy constructor) as proxies to observe if the block was copied, we
should keep both of them.

Commit, that first avoided the unnecessary copy:
faef7d034a9ec6cb757137adce8e8670ec6c2d7b

Diff Detail

Repository
rL LLVM

Event Timeline

yln created this revision.Apr 12 2019, 3:34 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 12 2019, 3:34 PM
Herald added subscribers: llvm-commits, Restricted Project, kubamracek. · View Herald Transcript
kubamracek added inline comments.Apr 15 2019, 10:25 AM
compiler-rt/test/tsan/Darwin/gcd-sync-block-copy.mm
3–6 ↗(On Diff #194974)

What is this change doing?

yln marked an inline comment as done.Apr 15 2019, 10:34 AM
yln added inline comments.
compiler-rt/test/tsan/Darwin/gcd-sync-block-copy.mm
3–6 ↗(On Diff #194974)

It's just changing to compile both binaries first, (instead of compile, check, compile, check) so that it is easier to debug/compare outputs in case the FileCheck fails. Also reformat line, so it's obvious that the only difference between those two line is -fno-sanitize=thread.

kubamracek accepted this revision.Apr 15 2019, 4:33 PM
This revision is now accepted and ready to land.Apr 15 2019, 4:33 PM
This revision was automatically updated to reflect the committed changes.