Files
clang-p2996/flang/test/Semantics/call16.f90
Peter Klausler d325c5d00b [flang] Extension: unrestricted intrinsics as specifics in generics
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
2023-08-08 10:46:24 -07:00

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