pushlevel ();
gfc_start_block (&iblock);
tree inner_clauses
- = gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_PARALLEL],
+ = gfc_trans_omp_clauses (&iblock, &clausesa[GFC_OMP_SPLIT_PARALLEL],
code->loc);
stmt = gfc_trans_omp_code (code->block->next, true);
stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,
end do
end subroutine
- ! TODO: This currently fails with an internal compiler error
- ! (PR 95869)
- !subroutine test_target_parallel
- ! do j = 1, N
- ! !$omp target parallel if(j .lt. LIMIT) map(tofrom: a(1:N))
- ! do i = 1, N
- ! a(i) = a(i) + 1
- ! end do
- ! !$omp end target parallel
- ! end do
- !end subroutine
+ subroutine test_target_parallel
+ do j = 1, N
+ !$omp target parallel if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ !$omp end target parallel
+ end do
+ end subroutine
subroutine test_target_parallel_loop
do j = 1, N
end module
-! { dg-final { scan-tree-dump-times "(?n)#pragma omp target.* if\\(" 8 "omplower" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp target.* if\\(" 9 "omplower" } }
! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7 "omplower" } }
-! { dg-final { scan-tree-dump-times "(?n)#pragma omp parallel.* if\\(" 5 "omplower" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp parallel.* if\\(" 6 "omplower" } }
--- /dev/null
+! PR fortran/95869
+! { dg-do compile }
+
+program pr95869
+ implicit none
+
+ integer, parameter :: N = 100
+ integer, parameter :: LIMIT = 60
+ integer :: i, j
+ integer, dimension(N) :: a = (/ (i, i = 1,N) /)
+ do j = 1, N
+ !$omp target parallel if(j .lt. LIMIT) map(tofrom: a(1:N))
+ do i = 1, N
+ a(i) = a(i) + 1
+ end do
+ !$omp end target parallel
+ end do
+end program