[PATCH] D137434: [lit] Add `target=<triple>` as a feature keyword

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 17:17:58 PST 2022


probinson added a comment.

In D137434#3917880 <https://reviews.llvm.org/D137434#3917880>, @dblaikie wrote:

> In D137434#3913191 <https://reviews.llvm.org/D137434#3913191>, @probinson wrote:
>
>> In D137434#3913083 <https://reviews.llvm.org/D137434#3913083>, @dblaikie wrote:
>>
>>> Should we instead support something more like the one in cross-project-tests, that adds a feature for every registered target? (that way a test can declare that it runs any time x86-registered-target is available, and it can specify the x86 target, so the test would run even on arm-default builds, for instance, so long as they also included x86?)
>>
>> That's not what I see cross-project-tests doing; it's checking whether any of the registered targets match the _host_ because it wants to be able to build/test executable programs running on the host.
>
> Not sure I follow - this code ( https://github.com/llvm/llvm-project/blob/e044796132abd9e10e21093822dc234003628fbd/cross-project-tests/lit.cfg.py#L256-L258 ) appears to be adding a `<arch>-registered-target` for every architecture that's enabled, not related to whether they match the host triple. Oh, and that's already in clang and used a lot there, so maybe porting that feature over to LLVM?
>
> But registered-target is for all the registered targets (& only the architecture, not the OS, etc, in the triple) - what's the particular need for the default target (unless it's native - which is useful for executing the code).

Assuming I captured the link correctly, what I was looking at is this:
https://github.com/llvm/llvm-project/blob/e044796132abd9e10e21093822dc234003628fbd/cross-project-tests/lit.cfg.py#L164

`REQUIRES: native` is probably a better choice for those cross-project-tests, it may be that the people who set up that directory were not aware of that feature keyword and rolled their own.  I don't know.  It wasn't my intent to fix things like that.


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

https://reviews.llvm.org/D137434



More information about the llvm-commits mailing list