X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=libgomp%2Ftestsuite%2Flibgomp.fortran%2Fnestedfn4.f90;fp=libgomp%2Ftestsuite%2Flibgomp.fortran%2Fnestedfn4.f90;h=c987bf440b04517350ab180f31dd1cb2aa95fe6e;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 b/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 new file mode 100644 index 00000000..c987bf44 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 @@ -0,0 +1,41 @@ +program foo + integer :: i, j, k + integer :: a(10), c(10) + k = 2 + a(:) = 0 + call test1 + call test2 + do i = 1, 10 + if (a(i) .ne. 10 * i) call abort + end do + !$omp parallel do reduction (+:c) + do i = 1, 10 + c = c + a + end do + do i = 1, 10 + if (c(i) .ne. 10 * a(i)) call abort + end do + !$omp parallel do lastprivate (j) + do j = 1, 10, k + end do + if (j .ne. 11) call abort +contains + subroutine test1 + integer :: i + integer :: b(10) + do i = 1, 10 + b(i) = i + end do + c(:) = 0 + !$omp parallel do reduction (+:a) + do i = 1, 10 + a = a + b + end do + end subroutine test1 + subroutine test2 + !$omp parallel do lastprivate (j) + do j = 1, 10, k + end do + if (j .ne. 11) call abort + end subroutine test2 +end program foo