[llvm] [TLI Checker] Extend the targets for Linux, macOS and Windows. (PR #114556)

Paul T Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 13:29:28 PDT 2024


pogo59 wrote:

As the author of `ps4-tli-check.yaml`: This test exists to test the _tool_ rather than testing TLI itself. If you want to test TLI, then you should put tests wherever other TLI tests live, not in `llvm/test/tools`. (It's possible that there are no other TLI tests, in which case it is understandable that someone would be misled into thinking `llvm/test/tools` is where the TLI tests should go. But it's not.)

More specifically, `ps4-tli-check.yaml` tests whether the tool can handle different kinds of object files, and how it reacts to mismatches between TLI's settings and the content of an object file for some target (which _just happens_ to be PS4, for no other reason than I was sure what functions were in the actual PS4 library). It is unfortunate that we have to pick some specific target for the test; that makes the test _look like_ it is testing that the TLI for PS4 is correct. That is not the test's purpose; it is an artifact of the test implementation. We'd be better off if we had some kind of fake target that would never change, but we don't. I am open to suggestions for adding commentary to `ps4-tli-check.yaml` (and possibly renaming it) to make this clearer.

So, if you want to add tests that TLI is _correct for a specific target_ then those tests should go somewhere else, probably under `llvm/test/Analysis`, and the test can use `llvm-tli-checker` to see whether some canned YAML list of functions matches what we expect to find. Those tests do _not_ need to try different object-file types, they do not need to play games with the name of one of the functions (i.e. the ZDAPV variable), they should just run `llvm-tli-checker` once and expect the correct result.

I apologize if some of this comment sounds a little upset. This exact point has come up a few times, which is frustrating, and we probably should try to keep the same misunderstanding from happening again.

https://github.com/llvm/llvm-project/pull/114556


More information about the llvm-commits mailing list