1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
3 ! 2.15.3.5 lastprivate Clause
4 ! A list item that is private within a parallel region, or that appears in
5 ! reduction clause of a parallel construct, must not appear in a
6 ! lastprivate clause on a worksharing construct if any of the corresponding
7 ! worksharing regions ever binds to any of the corresponding parallel regions.
9 program omp_lastprivate
10 integer :: a(10), b(10), c(10)
15 !$omp parallel reduction(+:a)
16 !ERROR: LASTPRIVATE variable 'a' is PRIVATE in outer context
17 !$omp sections lastprivate(a, b)
23 !$omp parallel private(a,b)
24 !ERROR: LASTPRIVATE variable 'a' is PRIVATE in outer context
25 !ERROR: LASTPRIVATE variable 'b' is PRIVATE in outer context
26 !$omp do lastprivate(a,b)
28 c(i
) = a(i
) + b(i
) + i
35 end program omp_lastprivate