25 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! OpenMP Version 5.2, Sections 3.2.1 & 5.33subroutine omp_lastprivate(init)4 integer :: init5 integer :: i, a(10)6 type my_type7 integer :: val8 end type my_type9 type(my_type) :: my_var10 11 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a LASTPRIVATE clause12 !$omp do lastprivate(a(2))13 do i=1, 1014 a(2) = init15 end do16 !$omp end do17 18 !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a LASTPRIVATE clause19 !$omp do lastprivate(my_var%val)20 do i=1, 1021 my_var%val = init22 end do23 !$omp end do24end subroutine25