v0.1.1
We got 'em all!
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:
Features:
Here's an overview of all FileCheck features and their implementation status.
- Checks:
-
CHECK -
CHECK-NEXT -
CHECK-NOT -
CHECK-LABEL#1 -
CHECK-EMPTY -
CHECK-SAME -
CHECK-DAG -
CHECK-COUNT
-
- Flags:
-
--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-overlapNot sure what this means yet. -
--allow-empty(I think I allow empty input rn?) -
--colorNo color support yet
-
- Base Features:
- Regex patterns
- Captures and Capture Matches
- Numeric Captures
- Numeric Substitutions (jesus christ, wtf man)
- Literal matching (
CHECK{LITERAL}) - Weird regex features (
[:xdigits:]and friends) - Correct(?) handling of matching check lines
- Testing:
- Base cases
- Negative tests
- Error messages (started)
- Lots of edge cases
- MLIR/xDSL integration tests
- UX:
- Good error messages: I have some error messages, but could be a lot better
- Parse errors
- Matching errors
- Malformed regexes
- Good error messages: I have some error messages, but could be a lot better
- Infrastructure:
- Formatting: black
- Pyright
-
pre-commit - CI for everything
We are open to PRs for bugfixes or any features listed here.
Differences to LLVMs FileCheck:
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.
Better Regexes
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.
Relaxed Matchings:
We relax some of the matching rules, like:
- Allow a file to start with
CHECK-NEXT
No Numerical Substitution
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.
Special Feature Flags:
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:\Vwill match any SSA value name (without the%)