brintos

brintos / llvm-project-archived public Read only

0
0
Text · 898 B · 3cca46c Raw
36 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Ensures that things that aren't procedures aren't allowed to be called.3module m4  integer :: i5  integer, pointer :: ip6  type :: t7  end type8  type :: pdt(k,len)9    integer, kind :: k10    integer, len :: len11  end type12  type(pdt(1,2)) :: x13  !ERROR: 'i' is not a variable14  namelist /nml/i15 contains16  subroutine s(d)17    real d18    !ERROR: 'm' is not a callable procedure19    call m20    !ERROR: Cannot call function 'i' like a subroutine21    call i22    !ERROR: Cannot call function 'ip' like a subroutine23    call ip24    !ERROR: 't' is not a callable procedure25    call t26    !ERROR: 'k' is not a procedure27    call x%k28    !ERROR: 'len' is not a procedure29    call x%len30    !ERROR: Use of 'nml' as a procedure conflicts with its declaration31    call nml32    !ERROR: Cannot call function 'd' like a subroutine33    call d34  end subroutine35end36