<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Using variable defined from expression on the same line can fail"
   href="https://bugs.llvm.org/show_bug.cgi?id=42896">42896</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using variable defined from expression on the same line can fail
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Test Suite
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>lit
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>thomas.preudhomme@celest.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>daniel@zuster.org, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following testcase fails:

RUN: FileCheck --input-file %s %s

FOO=67
BAR=68
BAR=69, BAZ:70
CHECK: FOO=[[#FOO:]]
CHECK: BAR=[[#BAR:FOO+1]]
CHECK: BAR=[[#BAR:FOO+2]], BAZ:[[#BAR+1]]


This is due to the commit r365220 which changes the use of
FileCheckNumericVariable to have only one instance per variable rather than one
instance per variable definition as previously. The two definitions of BAR
above thus share the same expression: FOO+1. Substitution works fine because it
does not get the expression from the variable. However setting the first value
of BAR will clear the expression, leading the evaluation of BAR+1 to consider
BAR as being undefined because its expression is null and thus it cannot
evaluate BAR.

I am working on a patch to solve this.</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>