Issue 108896
Summary [Flang] When a function subprogram is specified as the first argument of intrinsic function, it is not executed.
Labels flang
Assignees
Reporter ohno-fj
    ```
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
$
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to