22 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3 type dt4 real a5 end type6 contains7 subroutine s(a,b,p,unl)8 type(dt), optional :: a(:), b9 procedure(sin), optional :: p10 type(*), optional :: unl11 print *, present(a) ! ok12 print *, present(p) ! ok13 print *, present(unl) ! ok14 !ERROR: Argument of PRESENT() must be the name of a whole OPTIONAL dummy argument15 print *, present(a(1))16 !ERROR: Argument of PRESENT() must be the name of a whole OPTIONAL dummy argument17 print *, present(b%a)18 !ERROR: Argument of PRESENT() must be the name of a whole OPTIONAL dummy argument19 print *, present(a(1)%a)20 end21end22