summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-12 12:16:54 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-12 12:16:54 +0000
commit7ba2cc333dd01467a2a66705460d9cce9740d813 (patch)
tree393a1c7458b43284abbfb7883e8b69cce2548c5f /libgomp
parent1d4336dfdab0ff4b0da9f789543cf06f688535d3 (diff)
downloadgcc-7ba2cc333dd01467a2a66705460d9cce9740d813.tar.gz
PR fortran/32550
* trans.h (GFC_POINTER_TYPE_P): Define. * trans-types.c (gfc_sym_type): Set it for types on attr->sym.pointer. * trans-openmp.c (gfc_omp_privatize_by_reference): Return false if GFC_POINTER_TYPE_P is set on the type. * testsuite/libgomp.fortran/pr32550.f90: New test. * testsuite/libgomp.fortran/crayptr2.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126583 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog6
-rw-r--r--libgomp/testsuite/libgomp.fortran/crayptr2.f9030
-rw-r--r--libgomp/testsuite/libgomp.fortran/pr32550.f9020
3 files changed, 56 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 5836fff354b..20be557df94 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/32550
+ * testsuite/libgomp.fortran/pr32550.f90: New test.
+ * testsuite/libgomp.fortran/crayptr2.f90: New test.
+
2007-07-05 H.J. Lu <hongjiu.lu@intel.com>
* aclocal.m4: Regenerated.
diff --git a/libgomp/testsuite/libgomp.fortran/crayptr2.f90 b/libgomp/testsuite/libgomp.fortran/crayptr2.f90
new file mode 100644
index 00000000000..f8fce6b4760
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/crayptr2.f90
@@ -0,0 +1,30 @@
+! { dg-do run }
+! { dg-options "-fopenmp -fcray-pointer" }
+
+ use omp_lib
+ integer :: a, b, c, d, p
+ logical :: l
+ pointer (ip, p)
+ save ip
+!$omp threadprivate (ip)
+ a = 1
+ b = 2
+ c = 3
+ l = .false.
+!$omp parallel num_threads (3) reduction (.or.:l)
+ if (omp_get_thread_num () .eq. 0) then
+ ip = loc (a)
+ elseif (omp_get_thread_num () .eq. 1) then
+ ip = loc (b)
+ else
+ ip = loc (c)
+ end if
+ l = p .ne. omp_get_thread_num () + 1
+!$omp single
+ d = omp_get_thread_num ()
+!$omp end single copyprivate (d, ip)
+ l = l .or. (p .ne. d + 1)
+!$omp end parallel
+
+ if (l) call abort
+end
diff --git a/libgomp/testsuite/libgomp.fortran/pr32550.f90 b/libgomp/testsuite/libgomp.fortran/pr32550.f90
new file mode 100644
index 00000000000..907a768e6d5
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/pr32550.f90
@@ -0,0 +1,20 @@
+! PR fortran/32550
+! { dg-do run }
+
+ integer, pointer, save :: ptr
+ integer, target :: targ
+ integer :: e
+!$omp threadprivate(ptr)
+ e = 0
+ targ = 42
+!$omp parallel shared(targ)
+!$omp single
+ ptr => targ
+!$omp end single copyprivate(ptr)
+ if (ptr.ne.42) then
+!$omp atomic
+ e = e + 1
+ end if
+!$omp end parallel
+ if (e.ne.0) call abort
+ end