[PATCH] D154987: [lit] Implement PYTHON directive and config.prologue

Vlad Serebrennikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 12:47:45 PDT 2023


Endill added a comment.

In D154987#4532960 <https://reviews.llvm.org/D154987#4532960>, @jdenny wrote:

> Complex python will likely end up in a python module that is simply called from a PYTHON line.  That would look a lot like what people already do with `%python` in RUN.  But PYTHON gives people a convenient, well integrated way to keep their python local to the test when that makes the test easier to read and maintain.

I'd like to double this. I've already prepared a bit of python code <https://godbolt.org/z/5GWrT851E> to generate `-verify` prefixes that we need for DR testing, which I need in every test. `config.prologue` gives me an opportunity to move it to a separate file. We can even strive to have 0 explicit RUN lines in DR tests, generating everything in Python code defined in a single file. This way we wouldn't have to duplicate list of C++ language modes 27 times per each test file.

This helps establishing an environment where Clang contributors can focus on writing DR tests simply by following an example, without bothering with RUN lines. It also saves time, because there will be less to teach and less to iterate over during code review.

As a bottom line, there is a problem to solve for at least DR tests. I attempted to solve it in a less ambitious way in https://reviews.llvm.org/D150856. There you can also find detailed discussion of the problem I'm trying to solve. If this patch is going to be rejected, I'd like opponents to give me a different path forward.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154987/new/

https://reviews.llvm.org/D154987



More information about the llvm-commits mailing list