107 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12!C1129 3!A variable that is referenced by the scalar-mask-expr of a4!concurrent-header or by any concurrent-limit or concurrent-step in that5!concurrent-header shall not appear in a LOCAL locality-spec in the same DO6!CONCURRENT statement.7 8subroutine s1()9 10!ERROR: 'i' is already declared in this scoping unit11 do concurrent (i=1:10) local(i)12 end do13end subroutine s114 15subroutine s2()16!ERROR: 'i' is already declared in this scoping unit17 do concurrent (i=1:10) local_init(i)18 end do19end subroutine s220 21subroutine s4()22!ERROR: DO CONCURRENT expression references variable 'i' in LOCAL locality-spec23 do concurrent (j=i:10) local(i)24 end do25end subroutine s426 27subroutine s5()28 !OK because the locality-spec is local_init29 do concurrent (j=i:10) local_init(i)30 end do31end subroutine s532 33subroutine s6()34 !OK because the locality-spec is shared35 do concurrent (j=i:10) shared(i)36 end do37end subroutine s638 39subroutine s7()40!ERROR: DO CONCURRENT expression references variable 'i' in LOCAL locality-spec41 do concurrent (j=1:i) local(i)42 end do43end subroutine s744 45subroutine s8()46 !OK because the locality-spec is local_init47 do concurrent (j=1:i) local_init(i)48 end do49end subroutine s850 51subroutine s9()52 !OK because the locality-spec is shared53 do concurrent (j=1:i) shared(i)54 end do55end subroutine s956 57subroutine s10()58!ERROR: DO CONCURRENT expression references variable 'i' in LOCAL locality-spec59 do concurrent (j=1:10:i) local(i)60 end do61end subroutine s1062 63subroutine s11()64 !OK because the locality-spec is local_init65 do concurrent (j=1:10:i) local_init(i)66 end do67end subroutine s1168 69subroutine s12()70 !OK because the locality-spec is shared71 do concurrent (j=1:10:i) shared(i)72 end do73end subroutine s1274 75subroutine s13()76 ! Test construct-association, in this case, established by the "shared"77 integer :: ivar78 associate (avar => ivar)79!ERROR: DO CONCURRENT expression references variable 'ivar' in LOCAL locality-spec80 do concurrent (j=1:10:avar) local(avar)81 end do82 end associate83end subroutine s1384 85module m186 integer :: mvar87end module m188subroutine s14()89 ! Test use-association, in this case, established by the "shared"90 use m191 92!ERROR: DO CONCURRENT expression references variable 'mvar' in LOCAL locality-spec93 do concurrent (k=mvar:10) local(mvar)94 end do95end subroutine s1496 97subroutine s15()98 ! Test host-association, in this case, established by the "shared"99 ! locality-spec100 ivar = 3101 do concurrent (j=ivar:10) shared(ivar)102!ERROR: DO CONCURRENT expression references variable 'ivar' in LOCAL locality-spec103 do concurrent (k=ivar:10) local(ivar)104 end do105 end do106end subroutine s15107