X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libgomp%2Ftestsuite%2Flibgomp.fortran%2Fsharing2.f90;fp=libgomp%2Ftestsuite%2Flibgomp.fortran%2Fsharing2.f90;h=266dd46fadb01fce48266b57248044e05bea55a8;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libgomp/testsuite/libgomp.fortran/sharing2.f90 b/libgomp/testsuite/libgomp.fortran/sharing2.f90 new file mode 100644 index 00000000..266dd46f --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/sharing2.f90 @@ -0,0 +1,32 @@ +! { dg-do run } + + use omp_lib + integer :: i, j, k, m, n + logical :: l + equivalence (i, m) + equivalence (j, n) + i = 4 + j = 8 + l = .false. +!$omp parallel private (k) firstprivate (i) shared (j) num_threads (2) & +!$omp& reduction (.or.:l) + l = l .or. i .ne. 4 + l = l .or. j .ne. 8 +!$omp barrier + k = omp_get_thread_num () + if (k .eq. 0) then + i = 14 + j = 15 + end if +!$omp barrier + if (k .eq. 1) then + if (i .ne. 4 .or. j .ne. 15) l = .true. + i = 24 + j = 25 + end if +!$omp barrier + if (j .ne. 25 .or. i .ne. (k * 10 + 14)) l = .true. +!$omp end parallel + if (l) call abort + if (j .ne. 25) call abort +end