ffbdd78a4a
* testsuite/libgomp.oacc-fortran/abort-1.f90: Add 'dg-do run'. * testsuite/libgomp.oacc-fortran/abort-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/common-block-1.f90: Use 'stop' not abort(). * testsuite/libgomp.oacc-fortran/common-block-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/common-block-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/data-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/data-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/data-5.f90: Ditto. * testsuite/libgomp.oacc-fortran/dummy-array.f90: Ditto. * testsuite/libgomp.oacc-fortran/gemm-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/gemm.f90: Ditto. * testsuite/libgomp.oacc-fortran/host_data-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/host_data-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/host_data-4.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-collapse-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-collapse-4.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-independent.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-loop-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-map-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-parallel-loop-data-enter-exit.f95: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-6.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-vector-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-vector-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-4.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-5.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-6.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-7.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-reduction-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-12.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-13.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-14.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90: Likewise and also add 'dg-do run'. * testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction.f90: Ditto. From-SVN: r277503
108 lines
1.6 KiB
Fortran
108 lines
1.6 KiB
Fortran
! { dg-do run }
|
|
!
|
|
! Test data located inside common blocks. This test does not exercise
|
|
! ACC DECLARE.
|
|
|
|
module const
|
|
integer, parameter :: n = 100
|
|
end module const
|
|
|
|
subroutine check
|
|
use const
|
|
|
|
implicit none
|
|
integer i, x(n), y
|
|
common /BLOCK/ x, y
|
|
|
|
do i = 1, n
|
|
if (x(i) .ne. y) stop 1
|
|
end do
|
|
end subroutine check
|
|
|
|
module m
|
|
use const
|
|
integer a(n), b
|
|
common /BLOCK/ a, b
|
|
|
|
contains
|
|
subroutine mod_implicit_incr
|
|
implicit none
|
|
integer i
|
|
|
|
!$acc parallel loop
|
|
do i = 1, n
|
|
a(i) = b
|
|
end do
|
|
!$acc end parallel loop
|
|
|
|
call check
|
|
end subroutine mod_implicit_incr
|
|
|
|
subroutine mod_explicit_incr
|
|
implicit none
|
|
integer i
|
|
|
|
!$acc parallel loop copy(a(1:n)) copyin(b)
|
|
do i = 1, n
|
|
a(i) = b
|
|
end do
|
|
!$acc end parallel loop
|
|
|
|
call check
|
|
end subroutine mod_explicit_incr
|
|
end module m
|
|
|
|
subroutine sub_implicit_incr
|
|
use const
|
|
|
|
implicit none
|
|
integer i, x(n), y
|
|
common /BLOCK/ x, y
|
|
|
|
!$acc parallel loop
|
|
do i = 1, n
|
|
x(i) = y
|
|
end do
|
|
!$acc end parallel loop
|
|
|
|
call check
|
|
end subroutine sub_implicit_incr
|
|
|
|
subroutine sub_explicit_incr
|
|
use const
|
|
|
|
implicit none
|
|
integer i, x(n), y
|
|
common /BLOCK/ x, y
|
|
|
|
!$acc parallel loop copy(x(1:n)) copyin(y)
|
|
do i = 1, n
|
|
x(i) = y
|
|
end do
|
|
!$acc end parallel loop
|
|
|
|
call check
|
|
end subroutine sub_explicit_incr
|
|
|
|
program main
|
|
use m
|
|
|
|
implicit none
|
|
|
|
a(:) = -1
|
|
b = 5
|
|
call mod_implicit_incr
|
|
|
|
a(:) = -2
|
|
b = 6
|
|
call mod_explicit_incr
|
|
|
|
a(:) = -3
|
|
b = 7
|
|
call sub_implicit_incr
|
|
|
|
a(:) = -4
|
|
b = 8
|
|
call sub_explicit_incr
|
|
end program main
|