summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-08 17:30:41 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-08 17:30:41 +0000
commit7297507e8b901fe4fecf1282fc09d32a85712129 (patch)
tree895fe9745b208895dd570c4684446e8536a6eb42 /gcc/testsuite/gfortran.dg
parent69b18a8b03bc8cb57e9489f77da45dcab39c415c (diff)
downloadgcc-7297507e8b901fe4fecf1282fc09d32a85712129.tar.gz
PR fortran/44847
* match.c (match_exit_cycle): Error on EXIT also from collapsed !$omp do loops. Error on CYCLE to non-innermost collapsed !$omp do loops. * gfortran.dg/gomp/pr44847.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161967 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr44847.f9086
1 files changed, 86 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44847.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44847.f90
new file mode 100644
index 00000000000..3da4311499e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr44847.f90
@@ -0,0 +1,86 @@
+! PR fortran/44847
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+
+subroutine pr44847_1
+ integer :: i, j
+!$omp parallel do collapse(2)
+l:do i = 1, 2
+ do j = 1, 2
+ cycle l ! { dg-error "CYCLE statement" }
+ end do
+ end do l
+end subroutine
+subroutine pr44847_2
+ integer :: i, j, k
+!$omp parallel do collapse(3)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ cycle l ! { dg-error "CYCLE statement" }
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_3
+ integer :: i, j
+!$omp parallel do
+l:do i = 1, 2
+ do j = 1, 2
+ cycle l
+ end do
+ end do l
+end subroutine
+subroutine pr44847_4
+ integer :: i, j, k
+!$omp parallel do collapse(2)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ cycle l
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_5
+ integer :: i, j
+!$omp parallel do collapse(2)
+l:do i = 1, 2
+ do j = 1, 2
+ exit l ! { dg-error "EXIT statement" }
+ end do
+ end do l
+end subroutine
+subroutine pr44847_6
+ integer :: i, j, k
+!$omp parallel do collapse(3)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ exit l ! { dg-error "EXIT statement" }
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_7
+ integer :: i, j, k
+!$omp parallel do collapse(2)
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ exit l ! { dg-error "EXIT statement" }
+ end do
+ end do l
+ end do
+end subroutine
+subroutine pr44847_8
+ integer :: i, j, k
+!$omp parallel do
+ do i = 1, 2
+ l:do j = 1, 2
+ do k = 1, 2
+ exit l
+ end do
+ end do l
+ end do
+end subroutine