<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96886>96886</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
FileCheck not supporting large backrefs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
test-suite,
regex,
testing-tools
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tsymalla
</td>
</tr>
</table>
<pre>
If `update_test_checks.py` is ran on some lit test that contains a function with large signature and lots of metadata attached to it, all captures will be put in a single line.
For that, FileCheck can fail since it only supports up to `9` backrefs.
What is a feasible way to support such cases?
- Make update_test_checks.py count captures and split the lines containing the arguments into new lines
- Make FileCheck support more than `9` backrefs. The regex engine seems to include a `\g<num>` pattern, but it seems to not work here, `\{num}`, `${num}` and `$num` etc. don't work as well (talking about a backref of around 40). Also, this can cause quite a performance regression.
- Use named capture groups with unique names to refer to the value of an earlier capture. I am not sure about the perf hit though.
Any ideas? In my opinion, this is nothing the Python update script should handle.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVMGO4zYM_RrlQozhKIkTH3yYnWmAORTooUWPC1pibHVkyStSk-bvC9nJzi66l8Qm-Ei-x0cjsxsCUacOX9ThdYNZxpg64duE3uOmj_bWvV1ANXWeLQp9FWL5akYy71zNN9XU4BgSBogBOE4E3gmUJJARBUwMgi4wIFxyMOJigKuTETymgaB0R8mJAIMFH4UhXmAiQYuCgCJoRrIgEZwo_QLoPRicC4Th6ryHnmDOAi4AArsw-DJCoErVr6p-Pse0DFKwZ-fppUwOBgNc0PkCMAROIAZ_A87zHJMw5Ll0VE3dFoI9mvdEF76XXH__LuzcwouQXe8JrngrsHsV4GxGMMjEanf-EfoEv-M7wS8FBRNzkE-KRRaeF03HlRg_NHVhWIKYhjxREAYXJEKg65r3U7NP7o_xppioSBP-zxP-HAkSDfQvUBhcIGCiiZctBOOzJcCCUoeXQe1eQp7U7rdSYUYRSqGI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