<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/155459>155459</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] Incorrect result of `EXTENDS_TYPE_OF` when `MOLD` is unlimited polymorphic disassociated pointer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:runtime
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code:
```
class(*), pointer :: ptr1 => null()
class(*), pointer :: ptr2 => null()
allocate(integer :: ptr1)
print*, extends_type_of(ptr1, ptr2)
end
```
Flang outputs `F`, but the expected the outputs is `T` as the standard says about intrinsic `EXTENDS_TYPE_OF`
```
Result Value. If MOLD is unlimited polymorphic and is either a disassociated pointer or unallocated allocatable variable, the result is true;...
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMk99q3DoQxp9GvhlivLK1a1_4wvGuIXDOyaENpb1aZHlsq2gloz9J9u2L7A1NSwqFhZWY32i-b2bMnZOTRqwJuyfsmPDgZ2PrI9cSVdvOqJPeDNe6NdrJAS34GWE0SpkXqScQZkCSNyRryD67_bJGKO4coSWhDaEVoS0sRmqPFiKbN7B4uwOSH0l-Ah2UWtnqLzPph5lcKSO4R0LLmDD9WmxjFiu1X59uAV896sGd_XXBsxkJLTeuXUtsPOrhN2ckazrF9QQm-CV4B2SfdTFEW-iDX7uDrwsKj8N6eePkij6RfQbcrRHnuR64HcDxqwPem-BBam-ldlJE-PT16fTf8fP56dv_p_NjdxPwTswndEF5-MJVwBQeRvj38Z9jrBS0khcZJSxGXS_GLrMUwPUQgyj9jBY4DNJx54yQfCO3PhsLQb81c4DbifcK4ZlbGQ_RbHRgt_rSgbcBSX6fpul7iclQ50OVVzzBendge5rvsipP5poxPPByVxWCVges9kwUh5LlBVIxMl5WiaxpRllW0v3uwMpdnhZ9XpSR6XvKqnFPigwvXKpUqedLauyUSOcC1jvGClYliveo3LrTlI5xYCRvbNBeXpBQGhfd1jH1rg-TI0WmpPPu52NeerV-ElsuO8KDFsZaFP7NtRk_nhG8zKhjKA4j3v84jw_7nwSr6tn7xcXtpR2h3ST9HPpUmAuhXZR4-7tbrPmOwhPareYdod3N_3NNfwQAAP__eP009w">