This is an archive of the discontinued LLVM Phabricator instance.

update_test_checks.py: allow use with custom tools
ClosedPublic

Authored by nhaehnle on Oct 20 2022, 3:06 AM.

Details

Summary

We have a downstream project with a command-line utility that operates
pretty much exactly like opt. So it would make sense for us to
maintain tests with update_test_checks.py with our custom tool
substituted for opt, as this change allows.

Diff Detail

Event Timeline

nhaehnle created this revision.Oct 20 2022, 3:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 3:06 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
nhaehnle requested review of this revision.Oct 20 2022, 3:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 3:06 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Oct 20 2022, 7:49 AM
llvm/test/tools/UpdateTestChecks/update_test_checks/custom-tool.test
1

I can into this problem recently when trying to use llvm-extract. You could use that instead of relying on grep

nhaehnle updated this revision to Diff 469554.Oct 21 2022, 4:52 AM

In the test, use llvm-extract instead of grep

nhaehnle marked an inline comment as done.Oct 21 2022, 4:52 AM

Thanks, I also have a separate possible use case for this. Two minor inline comments.

llvm/utils/update_test_checks.py
10

Maybe update the example to use the new tool argument, and mention above that opt-like
tools are also supported?

122

Maybe also rename opt_args to tool_args, and replace opt by tool in the debug message below?

nhaehnle updated this revision to Diff 470760.Oct 26 2022, 2:46 AM

Address review comments.

jsilvanus accepted this revision.Oct 26 2022, 3:19 AM

LGTM, thanks!

This revision is now accepted and ready to land.Oct 26 2022, 3:19 AM
This revision was landed with ongoing or failed builds.Oct 27 2022, 1:07 AM
This revision was automatically updated to reflect the committed changes.