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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] When a function subprogram is specified as the first argument of intrinsic function, it is not executed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 20.0.0(1cc4c87198ec0c6febca3f6ed03357e9e091cfd4)/AArch64
```

When a `function subprogram (fun)` is specified as the first argument of `intrinsic function (EXTENDS_TYPE_OF)`, it is not executed.

The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.

sngtex00_3_.f90:
```fortran
module mod
  type ty
 integer :: ii
  end type ty
  type,extends(ty) :: ty1
 integer :: jj
  end type ty1
end module mod

program main
 use mod
  interface
     function fun()
       use mod
 type(ty1):: fun
     end function fun
  end interface
  type(ty) :: obj
  if(extends_type_of(fun(),obj).neqv..true.) print *,'ng'
end program main

function fun()
  use mod
  type(ty1):: fun
 fun%ii=20
  print *,'sngtex00_3:pass'
end function fun
```

```
$ flang-new sngtex00_3_.f90; ./a.out
$
```

```
$ gfortran sngtex00_3_.f90; ./a.out
$
```

```
$ ifort -diag-disable=10448 sngtex00_3_.f90; ./a.out
 sngtex00_3:pass
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU1v4zYQ_TX0hbBAjb4POnjjqLe2QIN-nAyKGsoMJNIlqWz87wtKcpzY2cX2sIBBg9TMmzdvhkPunOo1Yk2yLyTbb_jkj8bW5qjNVj5vWtOda5Kz9cf2hO3-ROuU0dRIKgeu-63Gr5QkOwosYhEjUMZCpKIs4qpEwUQusRU8kTl2LEmyAitkVSxklxKoCDS7nRXHPF3Ab2It619H1JRTkjM5aeFDcDe1J2t6y0dKoJSTDlg5o8pRd0KhpMKOckf9EalU1nnKbT-NqH3gTXKmtLdKOyXoGyaB8vHvp8df938cnv75_fHwW7OAEnigygdobTzFVxSTxy56z_AphDHDYL4q3VNucQ7s0Xm60gwgzUWusPlFGust15TrjqqwocKMJzXwQIZAswQKxCy6afAfAjrde3xl7JAcIlkxkuxu9FvRl9PRdNOAdDTdsqfUn09I_XndKu2xRxuqGAqp1MUMdXdjOm8JPOCrR905AqU_E6gurv4cf475_PwJ5mobTm4pLuulxiNXayp0ch8SCWGs5AIvB5ReKzr3RRmqeP1IbxCWfMpABqqVbPC7egR6HyDfJXIX_g3unSimfUteSQLlqt0h2B6MvDTwTBQegjVUkcZ_X6LI2wmjAHWySntKYEfggUChewLFVb17nZb120rcyPh9FWbvTCmS7IFdXG4YXTuSJLsTd-4DwXv9Pr3pt4eQvpsxdz3_hUYEGh6Zyb_Z_z_w_nIJfwL2cqe3neL9tlOOtwOSZB-zNC1_IBy91_O7NDZdnXRVUvEN1nEBeQZFmlebY83aLE1z4AVLirzMIM8qmSZZmceikILJjaqBQcqqOAfIirSKUOaYdEUsZVViKWKSMhy5GqJheBkjY_uNcm7COmZlWeWbgbc4uPkBAZirRQDCW2Lr4LBtp96RlA3KeXeF8MoP86szD0WS7ek65T8b8T821e9H-jcm92ayQ330_uRCp0NDoOmVP05tJMxIoAkk17_tyZpnFJ5AMyftCDRr3i81_BcAAP__Vq4edQ">