[cfe-dev] Easy way to generate lit tests for clang?

David Greene via cfe-dev cfe-dev at lists.llvm.org
Fri Jun 14 13:46:58 PDT 2019


Leonard Chan via cfe-dev <cfe-dev at lists.llvm.org> writes:

> I'm attempting to refactor a large test file and was hoping to see if
> there was an easier way to automatically update this test to check
> exact IR output. Perhaps something along the lines of
> `utils/update_llc_test_checks.py` in llvm, where the checks are
> automatically generated for each RUN to match IR exactly. Does such a
> tool exist?

Personally, I really would prefer we not go further down that road.
Such tests are very brittle and result in a lot of noise in diffs up for
review.  When I see tests like that in the diff I gloss over them
because they are so big.  I have no idea if the person who updated the
test just ran a script to do so or actually understood the differences
and deemed them correct.

Tests should be small and focused, checking only the very specific thing
they are testing.  We should be striving to change existing tests as
little as possible.

Over time, large tests should be broken up into several smaller tests if
possible.

                     -David


More information about the cfe-dev mailing list