Page MenuHomePhabricator

[update_(llc_)test_checks.py] Support pre-processing commands
AcceptedPublic

Authored by arichardson on Jan 21 2021, 7:34 AM.

Details

Summary

This has been rather useful in our downstream CHERI target where we want
to run tests both with addrspace(0) and addrspace(200) pointers.
With this patch we can prefix the opt command with
sed -e 's/addrspace(200)/addrspace(0)/g' -e 's/-A200-P200-G200//g' to
test both cases using the same IR input.

Diff Detail

Event Timeline

arichardson created this revision.Jan 21 2021, 7:34 AM
arichardson retitled this revision from [update_test_checks] Support pre-processing commands to [update_(llc_)test_checks.py] Support pre-processing commands.Jan 22 2021, 2:40 AM
arichardson edited the summary of this revision. (Show Details)

Add tests and also allow it in update_llc_test_checks.py

arichardson published this revision for review.Jan 22 2021, 2:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 2:42 AM
jdoerfert accepted this revision.Jan 22 2021, 7:40 AM

LGTM. Maybe wait a bit if someone else wants to take a look.

Now we also need to execute RUN lines without FileCheck and we are almost there ;)

This revision is now accepted and ready to land.Jan 22 2021, 7:40 AM

Is sed even allowed to be used in tests? Is it available in the required tool set?

Is sed even allowed to be used in tests? Is it available in the required tool set?

There are lots of uses in llvm/test/CodeGen/ for various architectures already.

Is sed even allowed to be used in tests? Is it available in the required tool set?

There are lots of uses in llvm/test/CodeGen/ for various architectures already.

Touché.
I'm uneasy about such tests, but the UpdateTestChecks is fine i guess.