aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergö Barany <gergo@codesourcery.com>2019-01-21 03:08:57 -0800
committerThomas Schwinge <thomas@codesourcery.com>2020-11-13 22:58:56 +0100
commitd1ba078d9bcc3457d36ba12695cfef29eb3ca942 (patch)
treeed343a478549505196d1f0050aee5bfe8bed62b7
parentd4a3152d3f3f62ccd614df5da6c3c0d2f6e5fa0d (diff)
downloadgcc-d1ba078d9bcc3457d36ba12695cfef29eb3ca942.zip
gcc-d1ba078d9bcc3457d36ba12695cfef29eb3ca942.tar.gz
gcc-d1ba078d9bcc3457d36ba12695cfef29eb3ca942.tar.bz2
Add 'libgomp.oacc-fortran/pr94358-1.f90' [PR94358]
Document status quo re PR94358 "[OMP] Privatize internal array variables introduced by the Fortran FE". libgomp/ PR fortran/94358 * testsuite/libgomp.oacc-fortran/pr94358-1.f90: New. Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f9034
1 files changed, 34 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90
new file mode 100644
index 0000000..5013c5ba
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+! { dg-additional-options "-fopt-info-omp-all" }
+
+subroutine kernel(lo, hi, a, b, c)
+ implicit none
+ integer :: lo, hi, i
+ real, dimension(lo:hi) :: a, b, c
+
+ !$acc kernels copyin(lo, hi) ! { dg-optimized "assigned OpenACC seq loop parallelism" }
+ !$acc loop independent
+ do i = lo, hi
+ b(i) = a(i)
+ end do
+ !$acc loop independent
+ do i = lo, hi
+ c(i) = b(i)
+ end do
+ !$acc end kernels
+end subroutine kernel
+
+program main
+ integer :: n = 20
+ real, dimension(1:20) :: a, b, c
+
+ a(:) = 1
+ b(:) = 2
+ c(:) = 3
+
+ call kernel(1, n, a, b, c)
+
+ do i = 1, n
+ if (c(i) .ne. 1) call abort
+ end do
+end program main