aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90')
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f9042
1 files changed, 42 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90 b/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90
new file mode 100644
index 00000000000..a5f3840f63c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90
@@ -0,0 +1,42 @@
+! This test checks if the runtime can properly handle implicit
+! firstprivate varaibles inside subroutines in modules.
+
+! { dg-do run }
+
+module test_mod
+ contains
+ subroutine test(x)
+
+ IMPLICIT NONE
+
+ INTEGER :: x, y, j
+
+ x = 5
+
+ !$ACC PARALLEL LOOP copyout (y)
+ DO j=1,10
+ y=x
+ ENDDO
+ !$ACC END PARALLEL LOOP
+
+ y = -1;
+
+ !$ACC PARALLEL LOOP firstprivate (y) copyout (x)
+ DO j=1,10
+ x=y
+ ENDDO
+ !$ACC END PARALLEL LOOP
+ end subroutine test
+end module test_mod
+
+program t
+ use test_mod
+
+ INTEGER :: x_min
+
+ x_min = 8
+
+ CALL test(x_min)
+
+ if (x_min .ne. -1) call abort
+end program t