brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 23d6bb4 Raw
66 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! Test for parsing confusion between array indexing and string subscripts3 4! This is okay: selects the whole substring5subroutine substring_0(c)6  character(:), pointer :: c7  !PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.8  !$omp task depend(out:c(:))9  !$omp end task10end11 12! This is okay: selects from the second character onwards13subroutine substring_1(c)14  character(:), pointer :: c15  !PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.16  !$omp task depend(out:c(2:))17  !$omp end task18end19 20! This is okay: selects the first 2 characters21subroutine substring_2(c)22  character(:), pointer :: c23  !PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.24  !$omp task depend(out:c(:2))25  !$omp end task26end27 28! Error29subroutine substring_3(c)30  character(:), pointer :: c31  !PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.32  !ERROR: Substrings must be in the form parent-string(lb:ub)33  !$omp task depend(out:c(2))34  !$omp end task35end36 37! This is okay: interpreted as indexing into the array not as a substring38subroutine substring_3b(c)39  character(:), pointer :: c(:)40  !$omp task depend(out:c(2))41  !$omp end task42end43 44! This is okay: no indexing or substring at all45subroutine substring_4(c)46  character(:), pointer :: c47  !$omp task depend(out:c)48  !$omp end task49end50 51! This is not okay: substrings can't have a stride52subroutine substring_5(c)53  character(:), pointer :: c54  !PORTABILITY: The use of substrings in OpenMP argument lists has been disallowed since OpenMP 5.2.55  !ERROR: Cannot specify a step for a substring56  !$omp task depend(out:c(1:20:5))57  !$omp end task58end59 60! This is okay: interpreted as indexing the array61subroutine substring_5b(c)62  character(:), pointer :: c(:)63  !$omp task depend(out:c(1:20:5))64  !$omp end task65end66