[committed] Add 'libgomp.oacc-fortran/allocatable-array-1.f90' (was: [gomp4] Properly handle allocatable scalars in acc update)

Message ID 87v9x2frgb.fsf@euler.schwinge.homeip.net
State New
Headers show
Series
  • [committed] Add 'libgomp.oacc-fortran/allocatable-array-1.f90' (was: [gomp4] Properly handle allocatable scalars in acc update)
Related show

Commit Message

Thomas Schwinge June 18, 2019, 10:40 p.m.
Hi!

On Thu, 8 Jun 2017 14:40:29 -0700, Cesar Philippidis <cesar@codesourcery.com> wrote:
> This patch fixes a bug I introduced while [...]


> 	libgomp/

> 	* testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New test.


This test case actually PASSes with current trunk, committed in r272448
"Add 'libgomp.oacc-fortran/allocatable-array-1.f90'", see attached.


Grüße
 Thomas

Patch

From 601722d6802378ebca4b7be0d6c53d6e6541b64c Mon Sep 17 00:00:00 2001
From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 18 Jun 2019 22:14:34 +0000
Subject: [PATCH] Add 'libgomp.oacc-fortran/allocatable-array-1.f90'

	libgomp/
	* testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New
	file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272448 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog                             |  5 ++++
 .../allocatable-array-1.f90                   | 27 +++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90

diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 62c45828a009..bd57e38ce19a 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-06-18  Cesar Philippidis  <cesar@codesourcery.com>
+
+	* testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New
+	file.
+
 2019-06-18  Thomas Schwinge  <thomas@codesourcery.com>
 
 	PR fortran/90743
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90
new file mode 100644
index 000000000000..c9a76385d9f7
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90
@@ -0,0 +1,27 @@ 
+! { dg-do run }
+
+program main
+  integer, parameter :: n = 40
+  integer, allocatable :: ar(:,:,:)
+  integer :: i
+
+  allocate (ar(1:n,0:n-1,0:n-1))
+  !$acc enter data copyin (ar)
+
+  !$acc update host (ar)
+
+  !$acc update device (ar)
+
+  call update_ar (ar, n)
+
+  !$acc exit data copyout (ar)
+end program main
+
+subroutine update_ar (ar, n)
+  integer :: n
+  integer, dimension (1:n,0:n-1,0:n-1) :: ar
+
+  !$acc update host (ar)
+
+  !$acc update device (ar)
+end subroutine update_ar
-- 
2.20.1