PR c++/80297
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / crayptr2.f90
blobc88cc7ab884af1c359d10a0b1258329a4155914b
1 ! { dg-do run }
2 ! { dg-options "-fopenmp -fcray-pointer" }
3 ! { dg-require-effective-target tls_runtime }
5 use omp_lib
6 integer :: a, b, c, d, p
7 logical :: l
8 pointer (ip, p)
9 save ip
10 !$omp threadprivate (ip)
11 a = 1
12 b = 2
13 c = 3
14 l = .false.
15 !$omp parallel num_threads (3) reduction (.or.:l) private (d)
16 if (omp_get_thread_num () .eq. 0) then
17 ip = loc (a)
18 elseif (omp_get_thread_num () .eq. 1) then
19 ip = loc (b)
20 else
21 ip = loc (c)
22 end if
23 l = p .ne. omp_get_thread_num () + 1
24 !$omp single
25 d = omp_get_thread_num ()
26 !$omp end single copyprivate (d, ip)
27 l = l .or. (p .ne. d + 1)
28 !$omp end parallel
30 if (l) call abort
31 end