mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:36:37 +00:00

The argument to the PRESENT() intrinsic function must be the name of a a whole OPTIONAL dummy argument. Fixes llvm-test-suite/Fortran/gfortran/regression/present_1.f90.
22 lines
660 B
Fortran
22 lines
660 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
module m
|
|
type dt
|
|
real a
|
|
end type
|
|
contains
|
|
subroutine s(a,b,p,unl)
|
|
type(dt), optional :: a(:), b
|
|
procedure(sin), optional :: p
|
|
type(*), optional :: unl
|
|
print *, present(a) ! ok
|
|
print *, present(p) ! ok
|
|
print *, present(unl) ! ok
|
|
!ERROR: Argument of PRESENT() must be the name of a whole OPTIONAL dummy argument
|
|
print *, present(a(1))
|
|
!ERROR: Argument of PRESENT() must be the name of a whole OPTIONAL dummy argument
|
|
print *, present(b%a)
|
|
!ERROR: Argument of PRESENT() must be the name of a whole OPTIONAL dummy argument
|
|
print *, present(a(1)%a)
|
|
end
|
|
end
|