[PATCH] D107162: [lit] Have REQUIRES support the target triple

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 09:40:44 PDT 2021


ldionne added a comment.

Sorry this went under my Radar, I think I was on vacation at the time when this discussion happened and it went straight to the bottom of my Differential email pile.

Anyway, what we do in libc++/libc++abi/libunwind is that we explicitly add a feature that has the name of the target triple, so that we're able to regex-match on it. I've never liked that the target triple is treated specially by Lit (IMO there shouldn't even be a notion of a target triple in Lit, since Lit is more general than just compiler testing). I think it used to be necessary because the triple was handled specially, but it doesn't need to anymore since one can regex-match on arbitrary features.

So one migration path could be:

1. Manually add a feature consisting of the target triple in all existing test suites (or have Lit add the triple as a feature automatically)
2. Migrate tests that use substring matching of triples to using regex-matching
3. Remove the special handling of target triples in Lit (since nobody should be using it)

To avoid confusion between the target triple as defined by Lit and the target triple as a feature, we've named the feature `target=<xxxxxx>` in libc++ and it works quite well. So for example, I moved a bunch of

  XFAIL: apple-macosx10.9
  XFAIL: apple-macosx10.10
  XFAIL: apple-macosx10.11

to instead become:

  XFAIL: target={{.+}}-apple-macosx10.{{9|10|11}}

Having a feature named `target=<xxx>` is a bit unusual, but it has been working really well and I feel like it clearly expresses the nature of the Lit feature.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107162



More information about the llvm-commits mailing list