X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libgomp%2Ftestsuite%2Flibgomp.fortran%2Fappendix-a%2Fa.22.7.f90;fp=libgomp%2Ftestsuite%2Flibgomp.fortran%2Fappendix-a%2Fa.22.7.f90;h=fff4e6d499751adbec92b62fb6fe8cb1f355983c;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libgomp/testsuite/libgomp.fortran/appendix-a/a.22.7.f90 b/libgomp/testsuite/libgomp.fortran/appendix-a/a.22.7.f90 new file mode 100644 index 00000000..fff4e6d4 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/appendix-a/a.22.7.f90 @@ -0,0 +1,33 @@ +! { dg-do run } +! { dg-require-effective-target tls_runtime } + + PROGRAM A22_7_GOOD + INTEGER, ALLOCATABLE, SAVE :: A(:) + INTEGER, POINTER, SAVE :: PTR + INTEGER, SAVE :: I + INTEGER, TARGET :: TARG + LOGICAL :: FIRSTIN = .TRUE. +!$OMP THREADPRIVATE(A, I, PTR) + ALLOCATE (A(3)) + A = (/1,2,3/) + PTR => TARG + I=5 +!$OMP PARALLEL COPYIN(I, PTR) +!$OMP CRITICAL + IF (FIRSTIN) THEN + TARG = 4 ! Update target of ptr + I = I + 10 + IF (ALLOCATED(A)) A = A + 10 + FIRSTIN = .FALSE. + END IF + IF (ALLOCATED(A)) THEN + PRINT *, "a = ", A + ELSE + PRINT *, "A is not allocated" + END IF + PRINT *, "ptr = ", PTR + PRINT *, "i = ", I + PRINT * +!$OMP END CRITICAL +!$OMP END PARALLEL + END PROGRAM A22_7_GOOD