<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Alternations in back-references are not handled correctly."
   href="https://llvm.org/bugs/show_bug.cgi?id=24879">24879</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Alternations in back-references are not handled correctly.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>charlesturner7c5@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm trying to match the following code in FileCheck

    rev r0, r0

For any ARM register r0. So my check line necessarily looks like this,

    CHECK:  rev [[R0:r[0-9]+|lr]], [[R0]]

Unfortunately, that fails to match. Letting test contain the above CHECK line,
I get

$ echo "rev r0, r0" | FileCheck test
test:1:8: error: expected string not found in input
CHECK: rev [[R0:r[0-9]+|lr]], [[R0]]
       ^
<stdin>:1:2: note: scanning from here
 rev r0, r0

If test instead contains the line 

     CHECK:  rev [[R0:r[0-9]+]], [[R0]]

It does match rev r0, r0. The alternation is the problem. I had a quick look at
the code and found that the above CHECK line essentially expands to this,

$ echo "rev lr, lr" | egrep '(r[0-9]+|lr), \1'

That egrep command *does* match, so indeed, there must be a bug in the
implementation in Regex.cpp, which appears to call out to something from
OpenBSD's libc/regex implementation.

I didn't get time to dig into that code. I also couldn't find any easily
searchable OpenBSD bug tracker in the 30 seconds I spent looking.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>