gcc/libgomp/testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95
Tom de Vries 9f620bf1ea Insert new bound in try_transform_to_exit_first_loop_alt
2015-07-10  Tom de Vries  <tom@codesourcery.com>

	* tree-parloops.c (try_transform_to_exit_first_loop_alt): If not found,
	insert nit + 1 bound.

	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95: New test.
	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95: New test.

	* gfortran.dg/parloops-exit-first-loop-alt-2.f95: New test.
	* gfortran.dg/parloops-exit-first-loop-alt.f95: New test.

From-SVN: r225655
2015-07-10 08:25:18 +00:00

41 lines
774 B
Fortran

! { dg-do run }
! { dg-additional-options "-O2" }
! { dg-additional-options "-ftree-parallelize-loops=2" }
! Constant bound, vector addition.
subroutine foo ()
integer, parameter :: n = 1000
integer, dimension (0:n-1) :: a, b, c
common a, b, c
integer :: ii
do ii = 0, n - 1
c(ii) = a(ii) + b(ii)
end do
end subroutine foo
program main
integer, parameter :: n = 1000
integer, parameter :: distrib = 10
integer, dimension (0:n-1) :: a, b, c
common a, b, c
integer :: i, j, k
do j = 0, ((n / distrib) -1)
do i = 0, distrib - 1
k = i + (distrib * j)
a(k) = k
b(k) = MODULO ((k * 3), 7)
c(k) = k * 2;
end do
end do
call foo ()
do i = 0, n - 1
if (c(i) .ne. (i + MODULO ((i * 3), 7))) call abort
end do
end program