| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/115039 |
| 3 |
! |
| 4 |
! Check that inquiry refs work with statement functions |
| 5 |
! |
| 6 |
! { dg-additional-options "-std=legacy -fdump-tree-optimized" } |
| 7 |
! { dg-prune-output " Obsolescent feature" } |
| 8 |
! { dg-final { scan-tree-dump-not "_gfortran_stop_numeric" "optimized" } } |
| 9 |
|
| 10 |
program testit |
| 11 |
implicit none |
| 12 |
complex :: x |
| 13 |
real :: im |
| 14 |
integer :: slen |
| 15 |
character(5) :: s |
| 16 |
im(x) = x%im + x%re + x%kind |
| 17 |
slen(s) = s%len |
| 18 |
if (im((1.0,3.0) + (2.0,4.0)) /= 14.) stop 1 |
| 19 |
if (slen('abcdef') /= 5) stop 2 |
| 20 |
end program testit |