diff mbox

[gomp4] Add Fortran runtime test

Message ID 566766B5.9050901@codesourcery.com
State New
Headers show

Commit Message

James Norris Dec. 8, 2015, 11:24 p.m. UTC
Hi,

Add test to exercise the kernels construct with the
pcreate clause.

Committed to gomp-4_0-branch.

Jim
diff mbox

Patch

Index: libgomp/ChangeLog.gomp
===================================================================
--- libgomp/ChangeLog.gomp	(revision 231430)
+++ libgomp/ChangeLog.gomp	(working copy)
@@ -1,3 +1,7 @@ 
+2015-12-08  James Norris  <jnorris@codesourcery.com>
+
+	* testsuite/libgomp.oacc-fortran/kernels-map-1.f90: Add new test.
+
 2015-12-08  Thomas Schwinge  <thomas@codesourcery.com>
 	    James Norris  <jnorris@codesourcery.com>
 
Index: libgomp/testsuite/libgomp.oacc-fortran/kernels-map-1.f90
===================================================================
--- libgomp/testsuite/libgomp.oacc-fortran/kernels-map-1.f90	(revision 231430)
+++ libgomp/testsuite/libgomp.oacc-fortran/kernels-map-1.f90	(working copy)
@@ -1,9 +1,9 @@ 
-! Test the copy, copyin, copyout, pcopy, pcopyin, and pcopyout
+! Test the copy, copyin, copyout, pcopy, pcopyin, pcopyout, and pcreate
 ! clauses on kernels constructs.
 
 program map
   integer, parameter     :: n = 20, c = 10
-  integer                :: i, a(n), b(n)
+  integer                :: i, a(n), b(n), d(n)
 
   a(:) = 0
   b(:) = 0
@@ -88,6 +88,20 @@ 
   !$acc end kernels
 
   call check (a, b, n)
+
+  ! PRESENT_OR_CREATE
+
+  a(:) = 0
+
+  !$acc kernels pcopyout (a) pcreate (d)
+  !$acc loop
+  do i = 1, n
+     d(i) = i
+     a(i) = d(i)
+  end do
+  !$acc end kernels
+
+  call check (a, b, n)
 end program map
 
 subroutine check (a, b, n)