This is an archive of the discontinued LLVM Phabricator instance.

Test that the single-threaded lit feature is available iff the corresponding guard is #defined
ClosedPublic

Authored by jroelofs on Oct 27 2014, 3:07 PM.

Details

Summary

Inspired by the test @EricWF added in r220722.

Diff Detail

Event Timeline

jroelofs updated this revision to Diff 15502.Oct 27 2014, 3:07 PM
jroelofs retitled this revision from to Test that the single-threaded lit feature is available iff the corresponding guard is #defined.
jroelofs updated this object.
jroelofs edited the test plan for this revision. (Show Details)
jroelofs added reviewers: EricWF, mclow.lists, danalbert.
jroelofs added subscribers: Unknown Object (MLST), EricWF.
EricWF edited edge metadata.Oct 27 2014, 3:19 PM

Why not make it fail at compile time?

#ifdef _LIBCPP_HAS_NO_THREADS
#error <error message>
#endif

int main() {}

Making it an execute test, IMHO, gives stronger guarantees that it's failing the way we want it to. I don't really have any other reasons to prefer one version over the other.

EricWF accepted this revision.Oct 27 2014, 3:39 PM
EricWF edited edge metadata.

I wasn't suggesting making it a .pass.cpp test. Just making it fail during compilation instead. I would prefer using a #error directive so the output of the test failure is clearer, but it's up to you.

Otherwise, LGTM.

This revision is now accepted and ready to land.Oct 27 2014, 3:39 PM

Nevermind... I'm being silly. Ignore my previous comment.

I don't really have a preference either way.

jroelofs updated this revision to Diff 15506.Oct 27 2014, 3:46 PM
jroelofs edited edge metadata.

Implement @EricWF's suggestion.

jroelofs closed this revision.Oct 27 2014, 3:50 PM

r220729