46 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12subroutine s1()3 character(10) str4 character(10) str15 !ERROR: Cannot reference function 'str' as data6 print *, str(1:9), str(7)7 block8 character(10) str29 character(10) str310 !ERROR: Cannot reference function 'str1' as data11 print *, str1(1:9), str1(7)12 print *, str2(1:9) ! substring is ok13 !ERROR: 'str2' is not a callable procedure14 print *, str2(7)15 !ERROR: Cannot reference function 'str3' as data16 print *, str3(7), str3(1:9)17 end block18end subroutine s119 20subroutine s2()21 character(10) func22 !ERROR: Cannot reference function 'func' as data23 print *, func(7), func(1:9)24end subroutine s225 26subroutine s3()27 real(8) :: func28 !ERROR: Cannot reference function 'func' as data29 print *, func(7), func(1:6)30end subroutine s331 32subroutine s4()33 real(8) :: local34 real(8) :: local135 !ERROR: Cannot reference function 'local' as data36 print *, local(1:6), local(7)37 !ERROR: Cannot reference function 'local1' as data38 print *, local1(7), local1(1:6)39end subroutine s440 41subroutine s5(arg)42 integer :: iVar43 external :: arg44 iVar = loc(arg)45end subroutine s546