aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f95
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f95')
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f9534
1 files changed, 34 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f95 b/libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f95
new file mode 100644
index 0000000..8014733
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/class-ptr-param.f95
@@ -0,0 +1,34 @@
+! { dg-do run }
+
+module typemod
+
+type mytype
+ integer :: a
+end type mytype
+
+contains
+
+subroutine mysub(c)
+ implicit none
+
+ class(mytype), allocatable :: c
+
+!$acc parallel copy(c)
+ c%a = 5
+!$acc end parallel
+end subroutine mysub
+
+end module typemod
+
+program main
+ use typemod
+ implicit none
+
+ class(mytype), allocatable :: myvar
+ allocate(mytype :: myvar)
+
+ myvar%a = 0
+ call mysub(myvar)
+
+ if (myvar%a .ne. 5) stop 1
+end program main