This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Mark tests that use check_assertion.h as requiring unix headers
ClosedPublic

Authored by john.brawn on Apr 28 2022, 9:03 AM.

Details

Summary

On targets without unistd.h or sys/wait.h (such as bare metal targets) any test that uses check_assertion.h will fail, so add REQUIRES: has-unix-headers to them and autodetect whether we have these headers or not.

These tests currently have unsupported on windows, but that's exactly because windows doesn't have these headers so we can remove the specific check for windows.

Diff Detail

Event Timeline

john.brawn created this revision.Apr 28 2022, 9:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2022, 9:03 AM
john.brawn requested review of this revision.Apr 28 2022, 9:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2022, 9:03 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

This looks sensible for our (ARM's) situation.

This looks like a nice cleanup in general but it breaks the MinGW builds.

libcxx/utils/libcxx/test/features.py
119

I think this name can be a bit more descriptive, for example has-header-unistd-h.

This looks like a nice cleanup in general but it breaks the MinGW builds.

MinGW does provide a unistd.h, but lacks sys/wait.h.

john.brawn retitled this revision from [libc++] Mark tests that use check_assertion.h as requiring unistd.h to [libc++] Mark tests that use check_assertion.h as requiring unix headers.
john.brawn edited the summary of this revision. (Show Details)

Also check for sys/wait.h, and rename the feature to has-unix-headers.

Mordante accepted this revision.May 5 2022, 9:09 AM

LGTM!

libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
8–9

Nit maybe merge the two unsupported lines, here and similar tests below.

This revision is now accepted and ready to land.May 5 2022, 9:09 AM

Thanks for this patch, this is actually really helpful for us downstream too.