Skip to content

FileCheck not supporting large backrefs #96886

Open
@tsymalla

Description

@tsymalla

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm-litquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions