llvm-project/flang/test/Semantics/dosemantics08.f90

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
314 B
Fortran
Raw Normal View History

! RUN: %S/test_errors.sh %s %t %f18
! C1138 --
! A branch (11.2) within a DO CONCURRENT construct shall not have a branch
! target that is outside the construct.
subroutine s1()
do concurrent (i=1:10)
[flang] # This is a combination of 2 commits. # This is the 1st commit message: Changes to disallow image control statements in DO CONCURRENT Most of these changes were already implemented. The last remaining part was to check for calls to move_alloc with coarray arguments. This set of changes implements that. I also bundled other changes. Specifically: All of the code to detect image control statements was moved from check-do.cc to tools.cc so that it could be used by other semantic checking functions. I added location information to the error messages for all DO semantics checks to highlight either the DO loop associated with the error or other relevant source locations. I cleaned up the error messages associated with DO semantics so that they have more consistent grammar and punctuation. I eliminated redundant checks for IEEE_GET_FLAG and IEEE_HALTING_MODE. I removed the redundant test doconcurrent08.f90. Responses to pull request comments I changed the interface to determine whether a statement is an image control statement to use an ExecutableConstruct as its input. Since ExecutableConstruct contains types that do not have source location information (ChangeTeamConstruct and CriticalConstruct), I also created a function to get the source location of an ExecutableConstruct. Also, some ExecutableConstructs are image control statements because they reference coarrays. I wanted to tell users that the reason that an ALLOCATE statement (for example) is an image control statement because it references a coarray. To make this happen, I added another function to return a message for image control statements that reference coarrays. I also cleaned up the references to the standard in comments in check-do.cc to briefly describe the contents of those constraints. I also added messages that refer to the enclosing DO CONCURRENT statement for error messages where appropriate. Responses to pull request comments The biggest change was to redo the implementation of "IsImageControlStmt()" to use a custom visitor that strips off the "common::Indirection<...>" prefix of most of the image control statement types and also takes advantage of "common::HasMember<...>" to determine if a variant contains a specific type. Spelling error. # This is the commit message flang-compiler/f18#2: More refactoring in response to comments on the pull request. Original-commit: flang-compiler/f18@3f0a0155b3fc3ae8bd81780c1254e235dc272b77 Reviewed-on: https://github.com/flang-compiler/f18/pull/780
2019-10-12 05:39:33 +08:00
!ERROR: Control flow escapes from DO CONCURRENT
goto 99
end do
99 print *, "Hello"
end subroutine s1