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

    <tr>
        <th>Summary</th>
        <td>
            [clang-cl] function internal linkage with comdat attribute cause linker to assert. 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            clang,
            c++,
            clang:frontend,
            ABI,
            clang-cl
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          jyu2-git
      </td>
    </tr>
</table>

<pre>
    The attached test assert in linker.
[t.zip](https://github.com/llvm/llvm-project/files/12455929/t.zip)

Command line:
[1 cmplrllvm-49889]$ clang-cl /Zc:inline /Ob2 /Ox -fprofile-instr-generate=code-%p-%m.profraw -flto  main.cpp a.cpp b.cpp outside.cpp -fuse-ld=lld
LLVM ERROR: Associative COMDAT symbol '??0?$TInputDataVertexModel@_N@Metasound@@QEAA@AEBVFName@@AEBUFDataVertexMetadata@1@@Z' does not exist.
PLEASE submit a bug report to https://software.intel.com/en-us/support/priority-support and include the crash backtrace.
Stack dump:
0.      Program arguments: d:\\iusers\\jyu2\\git\\xmain\\builds\\xmainefi2win_debug\\llvm\\bin\\lld-link -out:main.exe -libpath:d:\\iusers\\jyu2\\git\\xmain\\builds\\xmainefi2win_debug\\llvm\\lib\\clang\\17\\lib\\windows -nologo -mllvm:-mcpu=x86-64 -opt:lldlto=2 C:\\Users\\jyu2\\AppData\\Local\\Temp\\4\\clang-cl.EXE-2d8355\\main-0a5bd2.obj C:\\Users\\jyu2\\AppData\\Local\\Temp\\4\\clang-cl.EXE-2d8355\\a-9f00f7.obj C:\\Users\\jyu2\\AppData\\Local\\Temp\\4\\clang-cl.EXE-2d8355\\b-7dff4c.obj C:\\Users\\jyu2\\AppData\\Local\\Temp\\4\\clang-cl.EXE-2d8355\\outside-b50663.obj d:\\iusers\\jyu2\\git\\xmain\\builds\\xmainefi2win_debug\\llvm\\lib\\clang\\17\\lib\\windows\\clang_rt.profile-x86_64.lib
1. Running pass 'Function Pass Manager' on module 'ld-temp.o'.
2. Running pass 'X86 Assembly Printer' on function '@"??0?$TInputDataVertexModel@_N@Metasound@@QEAA@AEBVFName@@AEBUFDataVertexMetadata@1@@Z.17"'
Exception Code: 0xC000001D

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVs1u2zgQfhr6QlCQKNGyDz4otgUUSNpsmhZFLwFFjmS2FCnwp3H26ReUnDTd3cseGqxhUMPhcOajZvRxuPdqMAA7xK4QO6x4DCfrdt-eIiWDCqvOyqfd_QkwD4GLE0gcwAfMvQcXsDJYK_MdXIbyA8obxK5C9qeaEDsgujmFMHlUNoi2iLaDCqfYZcKOiLZa_3h-kMnZbyACom2vNHhE24JWjG3pFtF2cUe3F__zuLfjyI1MoSG5fw5dYDFO2s1Oq-1ms51hVFhobgYiNEa0_SpQ2SiTtqbph47OjzMm_eRsAkCU8cGRAQw4HgCVB2ElEETZlIYxS3aOP2LS62AxHrkymZgmzOexm0cbg1cSZpn00QPREpUHreWC9vr68w0-3t19uENlgxvvrVA8qB-A9x9uDs099k9jZxPiGpUtKts8PWh1_85MMRx44J_BBTjfWAkaVfnDe1TlNxC4t9FIVOWoyv84Ng2q8uZ49bl9z0dYtM3x6lP7ygEELnngqMqLxeArojWWFjw2NmA4Kx8u2b29PjYfj9jHblQBc9zFATuYrAs4WPxrtr3twyN3kCkTQF-yDobElF8fp7QL0XZyyjoVnshFhVNelRE6SsDhBFg47k-44-J7cFzABcnHwMV3LOM4veQ_z_D8u3V2cHzE3A1xBBMSJCyTGdsjtlfRg_OLnIp8kQYVFuGcsrmIXVRa-ldq6BV9VOZBQheHRT-X8WL9vE1rSdI3gYmNAZXNXB5wBky06iYeTqhsfj8crbpFmGt_EYv6b2uPykj76DExVtvBYjLODsqGjGKKqDycN2uyrjCxUzqJ1lIHi8oDxfuXA3z6N_zNNKUKWybXVnC9iPcwTotUvUJ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