<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65069>65069</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AMDGPU] Using OpenCL address spaces violates assertion
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
backend:AMDGPU,
OpenCL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jhuber6
</td>
</tr>
</table>
<pre>
The following code snippet causes an assertion to be hit when compiling for AMDGPU. This works as expected when using the numerical address spaces or when compiling for the NVPTX architecture.
```c++
int [[clang::opencl_constant]] x = 0;
```
See the compiler explorer link for a reproducer https://godbolt.org/z/x9PWr76qq.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUk1vnDAQ_TXmMsoKxguJDxx2g-ilH5GatL1V_pgFJ16b2CZJ--srIGmlqNIINLbnzXszT6ZkB0_UsvrI6q6Qcx5DbO_HWVFsChXMr_Z2JDgF58Kz9QPoYAiSt9NEGbScEyWQHmRKFLMNHnIARTDaDM8jedDhPFm3VJ5ChMOn7sPN3Q5uR5vgOcSHBDIBvUykM5mtYk7L6zwS-PlM0WrpQBoTKSVIk9SUIMT_gS8ln7_d3P4AGfVoM-k8R9qxsmPlgTXlFprhcYn11PoMq_SjdtIPjB8YP4SJvHY_dfApS59Z3bG6gxdgvIOS8eM7wC39SrQS2ChRXES5ECmCs_5h5Sch0hSDmTVFGHOe0tIPe4b9EIwKLu9CHBj2vxn2L-Lme7xsHh_f-K_fwrTcCC5kQW3VCM6ry4qXxdhy3KvmpE9CIe5PqPYC6dIYrcjwqqlEYVsskZdXKCpeY1XuyAiDojJXWlUCa8H2JZ2ldTvnns4LkcKmNFPb1GUjCicVubTaBHGbFSLDa4aopH4gbxg_bNv9e_FlIn_9cUnrrojtgnuh5iGxfelsyulfp2yzWz34ilB3cLe6YIN4v_4nG5zMi_HeXFfM0bXvRmrzOKudDmeG_dLp9XcxxXBPOjPsV4GJYb9q_BMAAP__ZPv5qw">