URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [threadprivate3.f90] - Rev 735
Compare with Previous | Blame | View Log
! { dg-do run }! { dg-require-effective-target tls_runtime }module threadprivate3integer, dimension(:,:), pointer :: foo => NULL()!$omp threadprivate (foo)end module threadprivate3use omp_libuse threadprivate3integer, dimension(:), pointer :: bar1integer, dimension(2), target :: bar2, varcommon /thrc/ bar1, bar2!$omp threadprivate (/thrc/)integer, dimension(:), pointer, save :: bar3 => NULL()!$omp threadprivate (bar3)logical :: ltype ttinteger :: ainteger :: b = 32end type tttype (tt), save :: baz!$omp threadprivate (baz)l = .false.call omp_set_dynamic (.false.)call omp_set_num_threads (4)var = 6!$omp parallel num_threads (4) reduction (.or.:l)bar2 = omp_get_thread_num ()l = associated (bar3)bar1 => bar2l = l.or..not.associated (bar1)l = l.or..not.associated (bar1, bar2)l = l.or.any (bar1.ne.omp_get_thread_num ())nullify (bar1)l = l.or.associated (bar1)allocate (bar3 (4))l = l.or..not.associated (bar3)bar3 = omp_get_thread_num () - 2if (omp_get_thread_num () .ne. 0) thendeallocate (bar3)if (associated (bar3)) call abortelsebar1 => varend ifbar2 = omp_get_thread_num () * 6 + 130l = l.or.(baz%b.ne.32)baz%a = omp_get_thread_num () * 2baz%b = omp_get_thread_num () * 2 + 1!$omp end parallelif (l) call abortif (.not.associated (bar1)) call abortif (any (bar1.ne.6)) call abortif (.not.associated (bar3)) call abortif (any (bar3 .ne. -2)) call abortdeallocate (bar3)if (associated (bar3)) call abortallocate (bar3 (10))bar3 = 17!$omp parallel copyin (bar1, bar2, bar3, baz) num_threads (4) &!$omp& reduction (.or.:l)l = l.or..not.associated (bar1)l = l.or.any (bar1.ne.6)l = l.or.any (bar2.ne.130)l = l.or..not.associated (bar3)l = l.or.size (bar3).ne.10l = l.or.any (bar3.ne.17)allocate (bar1 (4))bar1 = omp_get_thread_num ()bar2 = omp_get_thread_num () + 8l = l.or.(baz%a.ne.0)l = l.or.(baz%b.ne.1)baz%a = omp_get_thread_num () * 3 + 4baz%b = omp_get_thread_num () * 3 + 5!$omp barrierif (omp_get_thread_num () .eq. 0) thendeallocate (bar3)end ifbar3 => bar2!$omp barrierl = l.or..not.associated (bar1)l = l.or..not.associated (bar3)l = l.or.any (bar1.ne.omp_get_thread_num ())l = l.or.size (bar1).ne.4l = l.or.any (bar2.ne.omp_get_thread_num () + 8)l = l.or.any (bar3.ne.omp_get_thread_num () + 8)l = l.or.size (bar3).ne.2l = l.or.(baz%a .ne. omp_get_thread_num () * 3 + 4)l = l.or.(baz%b .ne. omp_get_thread_num () * 3 + 5)!$omp end parallelif (l) call abortend! { dg-final { cleanup-modules "threadprivate3" } }
