1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Tests for the index-name of a FORALL statement
15 subroutine hostAssoc()
16 integer, dimension(4) :: table
18 ! iGlobalVar is host associated with the global variable
20 FORALL (iGlobalVar
=1:4) table(iGlobalVar
) = 343
21 end subroutine hostAssoc
25 integer, dimension(4) :: tab
26 ! modVar is use associated with the module variable
27 FORALL (modVar
=1:4) tab(modVar
) = 343
28 end subroutine useAssoc
30 subroutine constructAssoc()
31 integer, dimension(4) :: table
33 associate (assocVar
=> localVar
)
34 ! assocVar is construct associated with localVar
35 FORALL (assocVar
=1:4) table(assocVar
) = 343
37 end subroutine constructAssoc
39 subroutine commonSub()
40 integer, dimension(4) :: tab
41 ! This reference is OK
42 FORALL (iCommonName
=1:4) tab(iCommonName
) = 343
43 end subroutine commonSub
46 integer, dimension(4) :: table
47 !ERROR: Index name 'typename' conflicts with existing identifier
48 FORALL (typeName
=1:4) table(typeName
) = 343
49 end subroutine mismatch