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
7 integer :: i
, j
, N
= 10
8 real :: arrayA(10), arrayB(10)
9 real, external :: foo
, bar
13 !$omp ordered depend(source)
15 !$omp ordered depend(sink: i - 1)
16 arrayB(i
) = bar(i
- 1)
24 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
25 !$omp ordered depend(source)
27 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
28 !$omp ordered depend(sink: i - 1)
29 arrayB(i
) = bar(i
- 1)
36 !$omp parallel do ordered(1)
38 !$omp ordered depend(source)
40 !$omp ordered depend(sink: i - 1)
41 arrayB(i
) = bar(i
- 1)
46 !$omp target parallel do ordered(1)
48 !$omp ordered depend(source)
50 !$omp ordered depend(sink: i - 1)
51 arrayB(i
) = bar(i
- 1)
53 !$omp end target parallel do
55 !$omp target teams distribute parallel do ordered(1)
57 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
58 !$omp ordered depend(source)
60 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
61 !$omp ordered depend(sink: i - 1)
62 arrayB(i
) = bar(i
- 1)
64 !$omp end target teams distribute parallel do
68 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
69 !$omp ordered depend(source)
71 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
72 !$omp ordered depend(sink: i - 1)
73 arrayB(i
) = bar(i
- 1)
77 !$omp parallel do ordered
79 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
80 !$omp ordered depend(source)
82 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
83 !$omp ordered depend(sink: i - 1)
84 arrayB(i
) = bar(i
- 1)
88 !$omp target parallel do ordered
90 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
91 !$omp ordered depend(source)
93 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
94 !$omp ordered depend(sink: i - 1)
95 arrayB(i
) = bar(i
- 1)
97 !$omp end target parallel do
101 !ERROR: The number of variables in DEPEND(SINK: vec) clause does not match the parameter specified in ORDERED clause
102 !$omp ordered depend(sink: i - 1) depend(sink: i - 1, j)
103 arrayB(i
) = bar(i
- 1, j
)
110 !ERROR: The number of variables in DEPEND(SINK: vec) clause does not match the parameter specified in ORDERED clause
111 !$omp ordered depend(sink: i - 1) depend(sink: i - 1, j)
112 arrayB(i
) = foo(i
- 1) + bar(i
- 1, j
)
117 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
118 !$omp ordered depend(source)
120 !ERROR: An ORDERED construct with the DEPEND clause must be closely nested in a worksharing-loop (or parallel worksharing-loop) construct with ORDERED clause with a parameter
121 !$omp ordered depend(sink: i - 1)