This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Mark tests that need pthread barriers with "UNSUPPORTED: darwin"
ClosedPublic

Authored by kubamracek on Nov 13 2015, 1:19 AM.

Details

Summary

Several testcases need pthread barriers (e.g. all bench_*.cc which use test/tsan/bench.h) which are not available on OS X. Let's mark them with "UNSUPPORTED: darwin".

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 40112.Nov 13 2015, 1:19 AM
kubamracek retitled this revision from to [tsan] Port test/tsan/bench.h to Darwin.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, samsonov, glider, kcc.
dvyukov added inline comments.Nov 13 2015, 2:14 AM
test/tsan/barrier.cc
5 ↗(On Diff #40112)

What's the point of testing our own implementation of barrier that nobody else uses (and so it's correctness is actually irrelevant)? We are not trying to re-implement on linux all darwin synchronization primitives like GCD, right. Can we just use the UNSUPPORTED directive, of if that does not work ifdef it out?

test/tsan/test.h
119 ↗(On Diff #40112)

I don't see a need for macros here. Please wrap it into functions with iface along the lines of:

typedef ... benchtime_t;
void bench_start(benchtime_t*);
unsigned long long bench_end(benchtime_t);

kubamracek updated this revision to Diff 40614.Nov 19 2015, 1:54 AM
kubamracek retitled this revision from [tsan] Port test/tsan/bench.h to Darwin to [tsan] Mark tests that need pthread barriers with "UNSUPPORTED: darwin".
kubamracek updated this object.

Updating patch to instead use "UNSUPPORTED: darwin" in tests that require pthread barriers.

kubamracek updated this revision to Diff 40615.Nov 19 2015, 1:59 AM

Adding "UNSUPPORTED: darwin" to one more test (test/tsan/barrier.cc).

dvyukov accepted this revision.Nov 19 2015, 2:17 AM
dvyukov edited edge metadata.

LGTM

My comment was related only to barrier tests.
As for benchmarks, they are still useful on mac. Eventually we need to change bench.h to not rely on pthread_barrier and grow clocks using some other synchronization primitive that is supported on all platforms.

This revision is now accepted and ready to land.Nov 19 2015, 2:17 AM
This revision was automatically updated to reflect the committed changes.

OK, I'll try to look at supporting the benchmarks on OS X later.