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

    <tr>
        <th>Summary</th>
        <td>
            #line 0 with debug info: cannot have column info without line info
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DimitryAndric
      </td>
    </tr>
</table>

<pre>
    As reported in https://bugs.freebsd.org/264853, compiling peg/leg (see https://www.piumarta.com/software/peg/) with clang and debug info turned on results in fatal backend errors:

```
cannot have column info without line info
!1417 = distinct !DILexicalBlock(scope: !1418, file: !9, column: 8)
cannot have column info without line info
!1417 = distinct !DILexicalBlock(scope: !1418, file: !9, column: 8)
fatal error: error in backend: Broken module found, compilation aborted!
```

This seems to be caused by the `#line 0` directives in https://www.piumarta.com/software/peg/peg-0.1.18/src/peg.peg-c. As far as I can determine, a `#line` directive should have a "non-negative decimal integer constant" as parameter, so zero seems to be explicitly allowed? But it is not handled correctly in the debug info case.

Minimized test case:

```c
// clang -cc1 -triple x86_64-- -S -debug-info-kind=standalone peg-min.c
int a();

void b() {
# 0
  if (a())
    ;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNVMlu2zAQ_Rr5MpCgxZblgw5xjQAB2lN7L0bkyGZDkQJJxUm-vkPJztYWyLGGIFOz8M28eWRn5VN748HRaF0gCcrAKYTRJ9VNUt7y001Hn_WOqPMys-7IprJeN5sqKb-AsMOotDJHGCl6NB0hKRtP9GGX8_mcjWoa0AXMOItN3vbhjI54uSQn5Q7OKpxAaOQd0UiQxPBcU28hTM5wfdZwrX7SwcdSewyooUNxTxxNzlk3Y-aHJL--6_zyzJ8CjbEBTvhAXL2eBrNsH4HtFICbodlyyS6LYl1sIakOIJUPyojAHRaHu6_0qATqvbbiPrYs7EgMDUtGE9nplb6adgtbES9a2L37P-tZGJ2ZjI55EZm-cBxte2d5CYOVkybo7cTmFy1gUDwi7GY1MdBfh7C8f5yUB5bK4CFY6Lh_nDyPuHuCcCKI0WU19x8zuV1HIqgH8n-K9DPy4neaZ0UWubj1TiymLJpFBnwGenSAHu64DsPKC-QGBo-t4Zti3pUCnoek5TI-jipLY01q6IizV5JQA9OpTKAjOabI-IAmcFxEGtHhEHEihrfwTM6-I4QeR62ECvoJUGt7ZkarW9izLBQ_HhblGKmZNWFdLIpDmZ3I35uzI9BT9pb6b8qoQT1zWiAfZv-_jo24Ci_yfDmaqRAFpMGpkQXw2NQ_63WaQvod0hk0jaDpvYpyOcSGJWrLY4xUM6XZZUtmBZClGrVX7d-CP1jFMlhckGyvvrKCi4AAVB8vmmv6Vb3Av9e9tocPvaxkW8ldtcNVYFKpfdHXcu-8MhZl_umTuZqcbt_r8cgxU3dRotYP1790dPYXT4k_lfcTeV5s6qKpV6e2anIhKyxIFtjTeiN6WTZ1IXeC5Hor6pXGjrRvk80-2RxWqi3zsszrsiq2-WazzppqU6PYFbhuKg7Pk3VOAyqdReB4c69cO9cQb3R2ar4-_KsTvVdHQ3TdHydu07UH1klwTzdGOiVWc9HtXPFvkajw-w">