At least one other Fortran compiler supports the use of unrestricted intrinsic functions as specific procedures in generic interfaces, and the usage seems to be both useful and unambiguous. Support it with a portability warning. Fixes llvm-test-suite/Fortran/gfortran/regression/pr95500.f90. Differential Revision: https://reviews.llvm.org/D157333
14 lines
338 B
Fortran
14 lines
338 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
|
|
! Test that intrinsic functions used as subroutines and vice versa are caught.
|
|
|
|
subroutine test(x, t)
|
|
intrinsic :: sin, cpu_time
|
|
!ERROR: Cannot call function 'sin' like a subroutine
|
|
call sin(x)
|
|
!ERROR: Cannot call subroutine 'cpu_time' like a function
|
|
x = cpu_time(t)
|
|
end subroutine
|
|
|
|
|