From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gfortran.dg/coarray_3.f90 | 100 ++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/coarray_3.f90 (limited to 'gcc/testsuite/gfortran.dg/coarray_3.f90') diff --git a/gcc/testsuite/gfortran.dg/coarray_3.f90 b/gcc/testsuite/gfortran.dg/coarray_3.f90 new file mode 100644 index 000000000..63c3bd335 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray_3.f90 @@ -0,0 +1,100 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! Coarray support +! PR fortran/18918 + +implicit none +integer :: n, m(1), k +character(len=30) :: str(2) + +critical fkl ! { dg-error "Syntax error in CRITICAL" } +end critical fkl ! { dg-error "Expecting END PROGRAM" } + +sync all (stat=1) ! { dg-error "Syntax error in SYNC ALL" } +sync all ( stat = n,stat=k) ! { dg-error "Redundant STAT" } +sync memory (errmsg=str) +sync memory (errmsg=n) ! { dg-error "must be a scalar CHARACTER variable" } +sync images (*, stat=1.0) ! { dg-error "Syntax error in SYNC IMAGES" } +sync images (-1) ! { dg-error "must between 1 and num_images" } +sync images (1) +sync images ( [ 1 ]) +sync images ( m(1:0) ) +sync images ( reshape([1],[1,1])) ! { dg-error "must be a scalar or rank-1" } +end + +subroutine foo +critical + stop 'error' ! { dg-error "Image control statement STOP" } + sync all ! { dg-error "Image control statement SYNC" } + return 1 ! { dg-error "Image control statement RETURN" } + critical ! { dg-error "Nested CRITICAL block" } + end critical +end critical ! { dg-error "Expecting END SUBROUTINE" } +end + +subroutine bar() +do + critical + cycle ! { dg-error "leaves CRITICAL construct" } + end critical +end do + +outer: do + critical + do + exit + exit outer ! { dg-error "leaves CRITICAL construct" } + end do + end critical +end do outer +end subroutine bar + + +subroutine sub() +333 continue ! { dg-error "leaves CRITICAL construct" } +do + critical + if (.false.) then + goto 333 ! { dg-error "leaves CRITICAL construct" } + goto 777 +777 end if + end critical +end do + +if (.true.) then +outer: do + critical + do + goto 444 + goto 555 ! { dg-error "leaves CRITICAL construct" } + end do +444 continue + end critical + end do outer +555 end if ! { dg-error "leaves CRITICAL construct" } +end subroutine sub + +pure subroutine pureSub() + critical ! { dg-error "Image control statement CRITICAL" } + end critical ! { dg-error "Expecting END SUBROUTINE statement" } + sync all ! { dg-error "Image control statement SYNC" } + error stop ! { dg-error "not allowed in PURE procedure" } +end subroutine pureSub + + +SUBROUTINE TEST + goto 10 ! { dg-warning "is not in the same block" } + CRITICAL + goto 5 ! OK +5 continue ! { dg-warning "is not in the same block" } + goto 10 ! OK + goto 20 ! { dg-error "leaves CRITICAL construct" } + goto 30 ! { dg-error "leaves CRITICAL construct" } +10 END CRITICAL ! { dg-warning "is not in the same block" } + goto 5 ! { dg-warning "is not in the same block" } +20 continue ! { dg-error "leaves CRITICAL construct" } + BLOCK +30 continue ! { dg-error "leaves CRITICAL construct" } + END BLOCK +end SUBROUTINE TEST -- cgit v1.2.3