Skip to content

Commit

Permalink
FileCheck: add page (#15433)
Browse files Browse the repository at this point in the history
Co-authored-by: Juri Dispan <[email protected]>
Co-authored-by: Sebastiaan Speck <[email protected]>
Co-authored-by: K.B.Dharun Krishna <[email protected]>
  • Loading branch information
4 people authored Jan 7, 2025
1 parent 5eb375a commit 26024a1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pages/common/filecheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# FileCheck

> Flexible pattern matching file verifier.
> It is typically used from LLVM regression tests and forms a part of a `lit` test.
> More information: <https://llvm.org/docs/CommandGuide/FileCheck.html>.
- Match `input_file` content with pattern file `check_file`:

`FileCheck --input-file={{path/to/input_file}} {{path/to/check_file}}`

- Match input from the `stdin` with pattern file `check_file`:

`echo "{{some_text}}" | FileCheck {{path/to/check_file}}`

- Match with the specified custom check `prefix` (Note: the default prefix is `CHECK`):

`echo "{{some_text}}" | FileCheck --check-prefix={{prefix}} {{path/to/check_file}}`

- Print good directive pattern matches:

`echo "{{some_text}}" | FileCheck -v {{path/to/check_file}}`

- Input `llvm_code.ll` into llvm-as, then pipe the output into FileCheck to match:

`llvm-as {{path/to/llvm_code.ll}} | FileCheck {{path/to/check_file}}`

0 comments on commit 26024a1

Please sign in to comment.