A Python-native clone of LLVMs FileCheck tool
OTHER License
|
) (#3)This release also marks a rename to filecheck
, from the former filecheck-ng
. The owners of filecheck
have graciously transferred their PyPi package name to this project.
Full Changelog: https://github.com/AntonLydike/filecheck/compare/v0.1.2...v1.0.0
Published by AntonLydike 4 months ago
This release contains:
CHECK-LABEL
to now be in-line with upstream (#1)--allow-empty
flagWith this we are able to pass 1530 out of 1645 (93%) of LLVMs MLIR filecheck tests.
Published by AntonLydike 4 months ago
First release with more-or-less all of FileChecks CHECK-*
features covered. Still missing lots of other flags, and currently tracking an inconsistency with how FileCheck handles CHECK-LABEL
, but otherwise pretty happy with this one!
Here's an excerpt from the README
specifying features:
Here's an overview of all FileCheck features and their implementation status.
CHECK
CHECK-NEXT
CHECK-NOT
CHECK-LABEL
#1
CHECK-EMPTY
CHECK-SAME
CHECK-DAG
CHECK-COUNT
--check-prefix
--check-prefixes
--comment-prefixes
--allow-unused-prefixes
--input-file
--match-full-lines
--strict-whitespace
(Kinda? Seems to be working.)--ignore-case
--implicit-check-not
--dump-input
--dump-input-context
--dump-input-filter
--enable-var-scope
-D<VAR=VALUE>
-D#<FMT>,<NUMVAR>=<NUMERIC EXPRESSION>
-version
-v
-vv
--allow-deprecated-dag-overlap
Not sure what this means yet.--allow-empty
(I think I allow empty input rn?)--color
No color support yetCHECK{LITERAL}
)[:xdigits:]
and friends)pre-commit
We are open to PRs for bugfixes or any features listed here.
We want to be as close as possible to the original FileCheck, and document our differences very clearly.
If you encounter a difference that is not documented here, feel free to file a bug report.
We use pythons regex library, which is a flavour of a Perl compatible regular expression (PCRE), instead of FileChecks
POSIX regex falvour.
Example:
// LLVM filecheck:
// CHECK: %{{[:alnum:]+}}, %{{[:digit:]+}}
// our fileheck:
// CHECK: %{{[a-zA-Z0-9]+}}, %{{\d+}}
Some effort is made to translate character classes from POSIX to PCRE, although it might be wrong in edge cases.
We relax some of the matching rules, like:
CHECK-NEXT
While our filecheck supports numeric capture
([[#%.3x,VAR:]]
will capture a three-digit hex number), we don't support arithmetic expressions on these captured
values at the moment. We also don't support the "Pseudo Numeric Variable" @LINE
.
This version of filecheck implements some non-standard extensions to LLVMs filecheck. These are disabled by default but
can be enabled through the environment variable FILECHECK_FEATURE_ENABLE=...
. Avialable extensions are documented here:
MLIR_REGEX_CLS
: Add additional special regex matchers to match MLIR/LLVM constructs:
\V
will match any SSA value name (without the %
)