1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp
3 ! Check OpenMP construct validity for the following directives:
4 ! 2.19.9 Ordered Construct
8 real :: a
, arrayA(10), arrayB(10), arrayC(10)
9 real, external :: foo
, bar
, baz
13 !ERROR: At most one THREADS clause can appear on the ORDERED directive
14 !$omp ordered threads threads
22 !ERROR: At most one SIMD clause can appear on the ORDERED directive
23 !$omp ordered simd simd
31 !ERROR: At most one SIMD clause can appear on the ORDERED directive
32 !$omp ordered simd simd
40 !ERROR: Only DEPEND(SOURCE) or DEPEND(SINK: vec) are allowed when ORDERED construct is a standalone construct with no ORDERED region
41 !ERROR: At most one DEPEND(SOURCE) clause can appear on the ORDERED directive
42 !$omp ordered depend(source) depend(inout: arrayA) depend(source)
44 !ERROR: DEPEND(SOURCE) is not allowed when DEPEND(SINK: vec) is present on ORDERED directive
45 !ERROR: DEPEND(SOURCE) is not allowed when DEPEND(SINK: vec) is present on ORDERED directive
46 !ERROR: At most one DEPEND(SOURCE) clause can appear on the ORDERED directive
47 !$omp ordered depend(sink: i - 1) depend(source) depend(source)
48 arrayB(i
) = bar(arrayA(i
), arrayB(i
-1))
49 !ERROR: Only DEPEND(SOURCE) or DEPEND(SINK: vec) are allowed when ORDERED construct is a standalone construct with no ORDERED region
50 !ERROR: Only DEPEND(SOURCE) or DEPEND(SINK: vec) are allowed when ORDERED construct is a standalone construct with no ORDERED region
51 !$omp ordered depend(out: arrayC) depend(in: arrayB)
52 arrayC(i
) = baz(arrayB(i
-1))
58 !ERROR: DEPEND(*) clauses are not allowed when ORDERED construct is a block construct with an ORDERED region
59 !$omp ordered depend(source)
62 !ERROR: DEPEND(*) clauses are not allowed when ORDERED construct is a block construct with an ORDERED region
63 !$omp ordered depend(sink: i - 1)
64 arrayB(i
) = bar(arrayA(i
), arrayB(i
-1))
71 !ERROR: THREADS, SIMD clauses are not allowed when ORDERED construct is a standalone construct with no ORDERED region
76 !ERROR: THREADS, SIMD clauses are not allowed when ORDERED construct is a standalone construct with no ORDERED region