blob: 0d00f8f56fe0c4cceec883df10fb931c262909f0 [file] [edit]
! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=52
! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=60
! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=61
! Test for parsing confusion between array indexing and string subscripts
! This is okay: selects the whole substring
subroutine substring_0(c)
character(:), pointer :: c
!PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.
!$omp task depend(out:c(:))
!$omp end task
end
! This is okay: selects from the second character onwards
subroutine substring_1(c)
character(:), pointer :: c
!PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.
!$omp task depend(out:c(2:))
!$omp end task
end
! This is okay: selects the first 2 characters
subroutine substring_2(c)
character(:), pointer :: c
!PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.
!$omp task depend(out:c(:2))
!$omp end task
end
! This is okay: interpreted as indexing into the array not as a substring
subroutine substring_3b(c)
character(:), pointer :: c(:)
!$omp task depend(out:c(2))
!$omp end task
end
! This is okay: no indexing or substring at all
subroutine substring_4(c)
character(:), pointer :: c
!$omp task depend(out:c)
!$omp end task
end
! This is not okay: substrings can't have a stride
subroutine substring_5(c)
character(:), pointer :: c
!PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.
!ERROR: Cannot specify a step for a substring
!$omp task depend(out:c(1:20:5))
!$omp end task
end
! This is an array section, so DEPEND forbids the explicit stride.
subroutine substring_5b(c)
character(:), pointer :: c(:)
!ERROR: 'c' in DEPEND clause must not specify a stride
!$omp task depend(out:c(1:20:5))
!$omp end task
end