[all-commits] [llvm/llvm-project] fec521: [lit] Add the ability to parse regexes in Lit bool...

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed Jun 30 07:52:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fec521a7b206815ad995f7247e671a8f25d144fc
      https://github.com/llvm/llvm-project/commit/fec521a7b206815ad995f7247e671a8f25d144fc
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2021-06-30 (Wed, 30 Jun 2021)

  Changed paths:
    M llvm/docs/TestingGuide.rst
    M llvm/utils/lit/lit/BooleanExpression.py
    M llvm/utils/lit/lit/Test.py
    M llvm/utils/lit/tests/Inputs/show-used-features/mixed.txt
    M llvm/utils/lit/tests/show-used-features.py

  Log Message:
  -----------
  [lit] Add the ability to parse regexes in Lit boolean expressions

This patch augments Lit with the ability to parse regular expressions
in boolean expressions. This includes REQUIRES:, XFAIL:, UNSUPPORTED:,
and all other special Lit markup that evaluates to a boolean expression.

Regular expressions can be specified by enclosing them in {{...}},
similarly to how FileCheck handles such regular expressions. The regular
expression can either be on its own, or it can be part of an identifier.
For example, a match expression like {{.+}}-apple-darwin{{.+}} would match
the following variables:

     x86_64-apple-darwin20.0
     arm64-apple-darwin20.0
     arm64-apple-darwin22.0
     etc...

In the long term, this could be used to remove the need to handle the
target triple specially when parsing boolean expressions.

Differential Revision: https://reviews.llvm.org/D104572




More information about the All-commits mailing list