<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/101571>101571</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Report error when a shader entry point is not found or it is marked `static`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hekota
</td>
</tr>
</table>
<pre>
Clang should report an error if a shader entry point function is not found in the input or of it is marked `static`.
**Case 1:**
Entry point function is not included in the input: https://godbolt.org/z/Yocb78xTe
```
void foo();
```
- DXC reports `error: missing entry point definition`
- Clang crashes
**Case 2:**
Entry point in shader is marked static: https://godbolt.org/z/e9Wxb74Mq
```
[numthreads(4,1,1)]
static void csmain() {}
```
- DXC reports `error: cannot find entry function csmain`
- Clang produces conflicting error and a warning about `numthreads` attribute
**Case 3:**
Entry point in shader library is marked static: https://godbolt.org/z/sc1jnjvPT
```
[shader("compute")]
[numthreads(4,1,1)]
static void csmain() {}
```
- DXC produces empty library, no error
- Clang produces warnings about `numthreads` and `shader` attributes
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lF1vmzAUhn-NuTlqBAcM4YKLJhnaRSdNW6Vtl8Y2wS3YzDZps18_8dE27ZqqmzSJJHJ8cj6e9-Rlzqm9lrIgdEPoLmCDb4wtGnlrPAsqI47FtmV6D64xQyvAyt5YD0yDtNZYUDUwcA0T0oLU3h6hN0p7qAfNvTIalANtPNRm0AKUBt9IULofPBgLpgblx5CO2VspgKSh88wrTtJwRcIdCS-XdxyfLXMSIhIvx_nqwxtVlebtIOTzwiS-hMb73k2JSoLl3ojKtH5l7J5g-Ytg-cPwKlvfX8ulfBouz3Q8GCWgNobgmmBO4s2rUXABu-_bhZgbZ5uQjeU75ZzS-2fEhKyVVmP3pxlm-Nwy10h3hgi-QUTpB3WeKC-I34FB5t_uqyz59PPVAQnd6KHzjZVMOILrhOA2ml85obs5aC4GEzLuOqb0TA1ItiHZ7m_JcaandVJaLPQeNV-y_wGvt0YMXDrgRtet4n4iP20v0wIY3DGrx-9YZQY_VjuZKg2BeW9VNXh5Bn_8Lvytqiyzx3-SwfHoRt8cPl-fk2GuMYFFbrp-bBbxVIb_ptUs1SNj2fX--DAswS1oM7N-iH6hycLenYWvZ1eYBzxVY_k3BKKIRR7nLJBFlCFSGtJ1HjRFhnmWRBFPuYgqjLGiPKklzVldJbFIWKAKDDEJ12GEGKW4Xq1DnrKUpZzSjNYyIkkoO6baVdseulGOQDk3yCIKI5pFQcsq2brJOBG1vIPpduROd4Etxh9dVMPekSRslfPuKY1Xvp0c9-PV1ytCd_BldtV5Ke8aqV831WdeOprvOe8MBtsWL7ZK-WaoVtx0BMuxk-XjorfmRnJPsJz6dwTLZcBDgb8DAAD__8TV47A">