aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.fortran/crayptr1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.fortran/crayptr1.f90')
-rw-r--r--gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.fortran/crayptr1.f9046
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.fortran/crayptr1.f90 b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.fortran/crayptr1.f90
new file mode 100644
index 000000000..57c59f71f
--- /dev/null
+++ b/gcc-4.2.1-5666.3/libgomp/testsuite/libgomp.fortran/crayptr1.f90
@@ -0,0 +1,46 @@
+! { dg-do run }
+! { dg-options "-fopenmp -fcray-pointer" }
+
+ use omp_lib
+ integer :: a, b, c, p
+ logical :: l
+ pointer (ip, p)
+ a = 1
+ b = 2
+ c = 3
+ l = .false.
+ ip = loc (a)
+
+!$omp parallel num_threads (2) reduction (.or.:l)
+ l = p .ne. 1
+!$omp barrier
+!$omp master
+ ip = loc (b)
+!$omp end master
+!$omp barrier
+ l = l .or. p .ne. 2
+!$omp barrier
+ if (omp_get_thread_num () .eq. 1 .or. omp_get_num_threads () .lt. 2) &
+ ip = loc (c)
+!$omp barrier
+ l = l .or. p .ne. 3
+!$omp end parallel
+
+ if (l) call abort
+
+ l = .false.
+!$omp parallel num_threads (2) reduction (.or.:l) default (private)
+ ip = loc (a)
+ a = 3 * omp_get_thread_num () + 4
+ b = a + 1
+ c = a + 2
+ l = p .ne. 3 * omp_get_thread_num () + 4
+ ip = loc (c)
+ l = l .or. p .ne. 3 * omp_get_thread_num () + 6
+ ip = loc (b)
+ l = l .or. p .ne. 3 * omp_get_thread_num () + 5
+!$omp end parallel
+
+ if (l) call abort
+
+end