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

    <tr>
        <th>Summary</th>
        <td>
            clang not emitting debug information with gsplit-dwarf option without -g option
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          kavitha-natarajan
      </td>
    </tr>
</table>

<pre>
    clang needs -g option to emit debug information along with -gsplit-dwarf option. If -gsplit-dwarf option is specified without -g option, no debug info is emitted and .dwo file is not created. Like other -g options, such as, -gdwarf-*, -gsplit-dwarf also should be enabling debug information. gcc compiler emits debug information with just -gsplit-dwarf option and does not require explicit -g option.

$ clang -gsplit-dwarf=split sample.c   // No debug info and no sample.dwo file generaged
$ clang -gsplit-dwarf=split -g sample.c  // sample.dwo file generated
$ gcc -gsplit-dwarf sample.c     // sample.dwo file generated

I tested with clang-14 & clang-15. It is not the case with older clang.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVF2PmzAQ_DXwsgLxmZQHHtJGJ51U9T8s9kKcczC1zaX9911M0uR0PJwUEVY7np0Zb9IZ-bcVGscBRiLpIBnATF6ZEbwBuigPkrp5ADX2xl4wdFAbxl-VPzHcTVr5RF7R9reTKbz2mw1QDtxEQvWKZDhvZv-YGBU_YDRP8xb8IsEzGkcJqbwa6JWmpTEaD8IScjOFn-qNwPgT2QedW_jcLE6A4TUZgpYkKg5r-SwQtTPgWI-W0BHQiJ1WbPKT-RQGIUCYy8Q6bJDnNiIK4Zxn57eDWNxIQ6sLS79nZXnoHwYK9ZRIGmXHKDvcnkUF6019oIzKY6jA4WXSlAoAiIoX_sCvD2EuMzneG-x_lAONZHEg-bUprO0x6DZnm9I_Uy6hfUziSe6XicLzFTw5f1ugVWuSV0yxuxc1b6C_7wgvBQh0tMKNlnxrAZfGsi1lUzYYe-U13X8GfCYs3eb1ryxbV_ppnePZ6vbk_eSi8rAaHBgzdylvDxdav9-_ksmaMwnPpXJuJt7Xl7qu8m_xqc1Q5NgIypqSsBf1ftdRte-6vUBqiIpYY0fatVH9PSqKka4QKPg9qo-xaousKLI6L7Nd3RRVmjd5KTDvJGVl3lVFVGV0QaXTRUdq7BDbNkhi446bWjnvHk10Tg38TxHGMT_O7Nq2b_jO1jAZ0aPFM45xENEGE_8A0Sh_iw">