This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove unnecessary main() function in .compile.pass.cpp and .verify.cpp tests
ClosedPublic

Authored by ldionne on Mar 16 2023, 9:52 AM.

Details

Summary

We pretty consistently don't define those cause they are not needed,
and it removes the potential pitfall to think that these tests are
being run. This doesn't touch .compile.fail.cpp tests since those
should be replaced by .verify.cpp tests anyway, and there would be
a lot to fix up.

As a fly-by, I also fixed a bit of formatting, removed a few unused
includes and made some very minor, clearly NFC refactorings such as
in allocator.traits/allocator.traits.members/allocate.verify.cpp where
the old test basically made no sense the way it was written.

Diff Detail

Event Timeline

ldionne created this revision.Mar 16 2023, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2023, 9:52 AM
ldionne requested review of this revision.Mar 16 2023, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2023, 9:52 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik accepted this revision.Mar 16 2023, 10:03 AM
philnik added a subscriber: philnik.

LGTM with green CI.

This revision is now accepted and ready to land.Mar 16 2023, 10:03 AM
Mordante accepted this revision.Mar 16 2023, 10:06 AM
Mordante added a subscriber: Mordante.

LGTM, did you also verify the verify and fail tests? If not, then that would be nice as a followup.

LGTM, did you also verify the verify and fail tests? If not, then that would be nice as a followup.

I'll do it for .verify.cpp tests too, however .compile.fail.cpp tests should move to .verify and there's a lot of them, so I'd rather tackle that separately (if at all for the time being).

ldionne updated this revision to Diff 506089.Mar 17 2023, 8:14 AM
ldionne retitled this revision from [libc++] Remove unnecessary main() function in .compile.pass.cpp tests to [libc++] Remove unnecessary main() function in .compile.pass.cpp and .verify.cpp tests.
ldionne edited the summary of this revision. (Show Details)

Also tackle .verify.cpp tests

The no-exceptions configuration is failing due to a clang bug that Mark is still bisecting AFAIK, so this is green.

This revision was landed with ongoing or failed builds.Mar 17 2023, 2:56 PM
This revision was automatically updated to reflect the committed changes.