brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 75968a6 Raw
67 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! OpenMP Version 5.13! Check OpenMP construct validity for the following directives:4! 2.19.9 Ordered Construct5 6program main7  integer :: i, N = 108  real :: a, arrayA(10), arrayB(10), arrayC(10)9  real, external :: foo, bar, baz10 11  !$omp do ordered12  do i = 1, N13    !ERROR: At most one THREADS clause can appear on the ORDERED directive14    !$omp ordered threads threads15    arrayA(i) = i16    !$omp end ordered17  end do18  !$omp end do19 20  !$omp simd21  do i = 1, N22    !ERROR: At most one SIMD clause can appear on the ORDERED directive23    !$omp ordered simd simd24    arrayA(i) = i25    !$omp end ordered26  end do27  !$omp end simd28 29  !$omp do simd ordered30  do i = 1, N31    !ERROR: At most one SIMD clause can appear on the ORDERED directive32    !$omp ordered simd simd33    arrayA(i) = i34    !$omp end ordered35  end do36  !$omp end do simd37 38  !$omp do ordered(1)39  do i = 2, N40    !ERROR: Only SINK or SOURCE dependence types are allowed when ORDERED construct is a standalone construct with no ORDERED region41    !ERROR: At most one SOURCE dependence type can appear on the ORDERED directive42    !$omp ordered depend(source) depend(inout: arrayA) depend(source)43    arrayA(i) = foo(i)44    !ERROR: The SINK and SOURCE dependence types are mutually exclusive45    !ERROR: At most one SOURCE dependence type can appear on the ORDERED directive46    !$omp ordered depend(sink: i - 1) depend(source) depend(source)47    arrayB(i) = bar(arrayA(i), arrayB(i-1))48    !ERROR: Only SINK or SOURCE dependence types are allowed when ORDERED construct is a standalone construct with no ORDERED region49    !ERROR: Only SINK or SOURCE dependence types are allowed when ORDERED construct is a standalone construct with no ORDERED region50    !$omp ordered depend(out: arrayC) depend(in: arrayB)51    arrayC(i) = baz(arrayB(i-1))52  end do53  !$omp end do54 55contains56  subroutine work1()57    !ERROR: Expected OpenMP END ORDERED directive58    !$omp ordered simd59  end subroutine work160 61  subroutine work2()62    !ERROR: Expected OpenMP END ORDERED directive63    !$omp ordered threads64  end subroutine work265 66end program main67