<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59553>59553</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            use relative lines in completion tests
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            sam-mccall
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sam-mccall
      </td>
    </tr>
</table>

<pre>
    tests under `clang/test/CodeComplete` are hard to maintain because they contain `-code-complete-at=%s:123:45` everywhere, and inserting/deleting text requires rewriting all the line numbers.
Probably other clang tests have this problem, but these are the worst.

Lit supports `%(line)` and FileCheck supports `[[@LINE]]` (and also `{{.*}}` where appropriate) to deal with this. `%(line)` was added in 2012 and never used - I wonder whether this is related to Google's downstream testrunner not supporting it :-)

plan:
 - add %(line) support to the private downstream testrunner
 - add a script to apply these replacements based on regex search
 - apply the script to the CodeComplete tests
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVNGuozgM_Rr3xaIKodDywENvu12NNFrtLxjiW7IbEjYJZfr3q6TM3HulkSIgVnx8fJwDhaDvlrmD-g2kDDQV0zCQMSAl1NcdLXF0vvuI73qnnl3kEAMuVrFHaMRgyN5B3lIY5O3iFF_cNBuODI1A8owjeYXR4UTaRtIWex5oCYxx5CcO7hWERhSDU1wMW3pBEaoryDpAdS5lBdX5UCdMfrB_riN7BnlBsgq1DeyjzkQUG06fGPlHRM__LdpzQM-r1zlOxqTKaLRltMvUsw97EFcQ57-966k3T3RxZI-5N3w1PNIjEdYBZ-96w1Oq3S8xQQXOfSbQ1fkQN7TX87uOGJZ5dj6G1CTIGuQpFQfZZomswps2fBl5-Pfr0fotrYP4_u2vP6C-ptUIBHlKOWSCy6eOb3B824M8w_GaViMwq4M0z97NXlNMtdIIFJPBVccxt7L_LZ-VApJSnGRFKUqZGdqkOi6BFRb4DVeXL8A6clYqC6OTyoYi52n_6dzdMMhjQOVWG6JnmrKYfrGWPVr3S5g0Fh0RqnORSHxSbzZkodo2WCRi-IXxT4hUMg1g9vpBkX9f8wsMYRi8nnMmzbN5bqP0PBsaeGIbA_aUOnYWPd_5BwYmP4wfMD_TPkGl3WcXvO7PTnWVaquWdtyVzbGUoirbdjd2R_WuelmdqGol9aJS3PalPB5EfVBieK92upNCylKWTVmLpmr3jerV4VQfFIm-Ho4nOAieSJu9MY9p7_x9p0NYuKvbuq52hno2YfP4y6zV-d07G9mqzem-S6lFv9wDHITRIYYPsKij4W7JwhiK-vFyTki3Y7OqdnbrcvGmG2Ock2VB3kDe7jqOS78f3ATylkC3VzF79w8P6Z-R6QaQt8z4_wAAAP__wtKBgQ">