36 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp2! OpenMP Version 4.53! 2.15.3.5 lastprivate Clause4! A list item that is private within a parallel region, or that appears in5! reduction clause of a parallel construct, must not appear in a6! lastprivate clause on a worksharing construct if any of the corresponding7! worksharing regions ever binds to any of the corresponding parallel regions.8 9program omp_lastprivate10 integer :: a(10), b(10), c(10)11 12 a = 1013 b = 2014 15 !$omp parallel reduction(+:a)16 !ERROR: LASTPRIVATE variable 'a' is PRIVATE in outer context17 !$omp sections lastprivate(a, b)18 !$omp section19 c = a + b20 !$omp end sections21 !$omp end parallel22 23 !$omp parallel private(a,b)24 !ERROR: LASTPRIVATE variable 'a' is PRIVATE in outer context25 !ERROR: LASTPRIVATE variable 'b' is PRIVATE in outer context26 !$omp do lastprivate(a,b)27 do i = 1, 1028 c(i) = a(i) + b(i) + i29 end do30 !$omp end do31 !$omp end parallel32 33 print *, c34 35end program omp_lastprivate36