Linux command
filecheck 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Run FileCheck on
FileCheck [check-file] < [input]
Check with patterns
FileCheck --input-file=[input] [check-file]
Enable verbose output
FileCheck -v [check-file] < [input]
Require full line matches
FileCheck --match-full-lines [check-file] < [input]
说明
FileCheck is an LLVM testing tool that verifies text output matches specified patterns. It reads a file containing CHECK directives and verifies they match against input, commonly compiler output. The tool supports various check types: CHECK for sequential matching, CHECK-NEXT for consecutive lines, CHECK-NOT for absence, CHECK-SAME for same-line matches, CHECK-DAG for unordered matches, CHECK-LABEL for scoping, and CHECK-EMPTY for blank lines. FileCheck is essential for LLVM and compiler testing, validating generated code matches expected patterns.
参数
- --input-file _FILE_
- Input file to verify.
- -v, --verbose
- Print good matches.
- --match-full-lines
- Require full line matches.
- --strict-whitespace
- Strict whitespace matching.
- --check-prefix _PREFIX_
- Use custom check prefix (default: CHECK).
- --check-prefixes _PREFIXES_
- Comma-separated list of check prefixes.
- -vv
- Print information useful for diagnostic analysis.
- --dump-input _MODE_
- Dump annotated input on failure (help, always, fail, never).
- --allow-empty
- Allow the check file to be empty.
- --help
- Display help information.
FAQ
What is the filecheck command used for?
FileCheck is an LLVM testing tool that verifies text output matches specified patterns. It reads a file containing CHECK directives and verifies they match against input, commonly compiler output. The tool supports various check types: CHECK for sequential matching, CHECK-NEXT for consecutive lines, CHECK-NOT for absence, CHECK-SAME for same-line matches, CHECK-DAG for unordered matches, CHECK-LABEL for scoping, and CHECK-EMPTY for blank lines. FileCheck is essential for LLVM and compiler testing, validating generated code matches expected patterns.
How do I run a basic filecheck example?
Run `FileCheck [check-file] < [input]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --input-file _FILE_ do in filecheck?
Input file to verify.