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

    <tr>
        <th>Summary</th>
        <td>
            `assert` inside OpenMPTarget region leads to link errors
        </td>
    </tr>

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

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

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

<pre>
    Using `assert` inside a `target` region gave me the following link errors:

Compiler version - 18 (last night's build)
Hardware - NVIDIA A100


```shell
ptxas /tmp/ft_example_vector-95448c.s, line 3411; error   : Type of argument does not match formal parameter '__assert_fail_param_2'
ptxas /tmp/ft_example_vector-95448c.s, line 3411; error   : Alignment of argument does not match formal parameter '__assert_fail_param_2'
ptxas /tmp/ft_example_vector-95448c.s, line 3411; error   : Type of argument does not match formal parameter '__assert_fail_param_3'
ptxas /tmp/ft_example_vector-95448c.s, line 3411; error   : Alignment of argument does not match formal parameter '__assert_fail_param_3'
ptxas /tmp/ft_example_vector-95448c.s, line 3411; error   : Call has wrong number of parameters
ptxas /tmp/ft_example_vector-95448c.s, line 3441; error   : Type of argument does not match formal parameter '__assert_fail_param_2'
ptxas /tmp/ft_example_vector-95448c.s, line 3441; error   : Alignment of argument does not match formal parameter '__assert_fail_param_2'
ptxas /tmp/ft_example_vector-95448c.s, line 3441; error   : Type of argument does not match formal parameter '__assert_fail_param_3'
ptxas /tmp/ft_example_vector-95448c.s, line 3441; error   : Alignment of argument does not match formal parameter '__assert_fail_param_3'
ptxas /tmp/ft_example_vector-95448c.s, line 3441; error   : Call has wrong number of parameters
ptxas /tmp/ft_example_vector-95448c.s, line 5015; error   : Type of argument does not match formal parameter '__assert_fail_param_2'
ptxas /tmp/ft_example_vector-95448c.s, line 5015; error   : Alignment of argument does not match formal parameter '__assert_fail_param_2'
ptxas /tmp/ft_example_vector-95448c.s, line 5015; error   : Type of argument does not match formal parameter '__assert_fail_param_3'
ptxas /tmp/ft_example_vector-95448c.s, line 5015; error   : Alignment of argument does not match formal parameter '__assert_fail_param_3'
ptxas /tmp/ft_example_vector-95448c.s, line 5015; error   : Call has wrong number of parameters
ptxas fatal   : Ptx assembly aborted due to errors
clang++: error: ptxas command failed with exit code 255 (use -v to see invocation)
clang version 18.0.0 (https://github.com/llvm/llvm-project.git de7fa3ab9a4ed05e7e4ef05b0919db52383969c5)
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMlj-P4zYQxT8N1QxsUKT-WIUK7y6MXJHkiktaYySOJCYUKZCUvfvtA8m7zgG55rI2YICgbRIz_M3zKx6GoHtLVLP8ieUvCc5xcL72Pb5h9FrIpHHqrf4jaNsDKziGQD6ygoO2QSsCXE4j-p7WU0-9dhZ6PBGMBHEg6Jwx7rzUG23_BvLe-cDknvEXxt_3ZzdO2pCHE_mwNNhAugMmdgZDBKv7ITJRBmhmbRQT1aXqF_TqjJ5gA7_9-eXlyx72Keff933fC35ZYSBjLmdTfMUATBziODFx6OKRXnGcDB1P1EbnN1WeZbt2G5h4XsAJZJamTD5dBgAAJvfw7W0icB2g7-eRbATlKIB1EUaM7QCd8yMamNDjSJE8MFEejxcRjx1qc1yvjoKJ8pZce6N7uwI9INytRJOPLNqt4Z7RGBgwwNk724Odx4b8AnolCf__uexBjf1frgcy9v1E-5x37izareHuaOycp_kjGvtHXA9j7HuK9hnv3F20W8P9pLE7jGjeS7_GV1gAx8a8ATbOR1KgZoLoPvLTWtkatD0TT8uS-8vV8uXSsXXjiFbBMiMpOOs4AL3qCK1TBCLPl4A1B4LNaWkciEDbk2sxamevIWt945rL0t2Wb_lSOMQ4rTFOHJg49DoOc7Nt3cjEwZjTx8dm8u4vauO21xEUlR1KbCrMSPGcSsqo43nDq7RSTS7kTlZF1ebXt6_B7fIzUbVUlawwoTotqpQLwblIhroosRDFrsvSCmXOM1VVRVlJxWVe7rIsTXQtuJB8xyXnS802lWXeoKpS7KpSkmQZpxG12S7QW-f7RIcwU11ksuCJwYZMWDOyEJbOsF4yIZbI7Ot10GbuA8u40SGGf7tEHQ3VPwrOv09kf_36bU3OH7HZEKqw_BffJeVk9qb-ObGZOKyAgYnDOsA_AQAA__8x0-Zt">