FileCheck: strange regexp match behavior on CFI tests
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
I encountered CFI test failures in tests similar to compiler-rt/test/cfi/multiple-inheritance.cpp when using a libc implementation that outputs additional debug information.
The issue occurs with FileCheck patterns like:
```
// RUN: FileCheck -check-prefix=CFI -input-file %s %s
Some string 12
1
CFI: 1
CFI-NOT: {{^2$}}
```
This test fails, but if 1 is replaced with `{{^1$}}`, it passes.
Expected Behavior:
- `CFI: 1` should match the digit 1 on owns line
- `CFI-NOT: {{^2$}}` should not find 2 (because in this test there is no string that contains only '2')
Current Behavior:
- `CFI-NOT: {{^2$}}` pattern incorrectly matches, suggesting that after matching 1.
Questions:
- Is this the expected behavior of FileCheck?
Contributor guide
Research direction
Reproduce the command shown in compiler-rt/test/cfi/multiple-inheritance.cpp with the adjacent CFI and CFI-NOT patterns. Start by checking how FileCheck interprets line anchors and the search region after a positive match. Done means the behavior is explained and either corrected or documented as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100