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

    <tr>
        <th>Summary</th>
        <td>
            [SPIR-V] Broken test llvm/test/CodeGen/SPIRV/debug-info/debug-type-basic.ll
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:SPIR-V,
            SPIR-V
      </td>
    </tr>

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

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

<pre>
    Since a recent SPIRV-Tools commit (f3c4a5053f1bd34056282e56659659873f9d47ad), this particular test is broken.

```
error: line 86: NonSemantic.Shader.DebugInfo.100 DebugTypeBasic: expected operand Flags must be a result id of 32-bit unsigned OpConstant
  %52 = OpExtInst %void %49 DebugTypeBasic %51 %uint_8 %uint_2 %20
```

The reason is the emitted SPIR-V does this:

```
%20 = OpConstantNull %9
%-- = OpExtInst %-- %-- DebugTypeBasic %-- %-- %-- %20
```

The last operand if the `Flags` operand, which form the spec:
```
Flags is the <id> of a 32-bit integer OpConstant formed by the bitwise-OR of values from the Debug Info Flags table.
```

Since the flag value is 0, we emit an `OpConstantNull`, but this is not accepted by the validator.
I'm not sure if that's a validation issue (shall `OpConstantNull %uint` be  the same as `OpConstant %uint 0` ?) or not.
Opening an issue in SPIRV-Tools
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VF1v4ygU_TX45SoWxh-xH_yQppNVtdJ0Na3mdYXhOmYHgwW4M_33K3CSdlqNZBEI9-Occy-Xe6_OBrEn9R2p7zO-hsm6_m9EswafDVa-9k_KCAQODgWaAE__PHz7vnu2VnsQdp5VAMLasRQVr2ldjsUgy4rWDWsZ1k1Td03dtfty7GS155KwjrAjhEl5WLgLSqyaOwjoAygPg7M_0OSEHuLX0MtHD-icdaQ8gFYGoW3i9qs1TzhzE5TInyYu0eX3OKznBzPavKAU0un5dcE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