Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/coarray_24.f90 @ 144:8f4e72ab4e11
fix segmentation fault caused by nothing next cur_op to end
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 23 Dec 2018 21:23:56 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do compile } ! { dg-options "-fcoarray=single -Wall" } ! ! This program is perfectly valid; however, passing an (allocatable) coarray ! as actual argument to a non-coarray allocatable dummy is doubtful as ! reallocation is not allowed. Thus, an intent(out) dummy should be always ! wrong. ! integer, allocatable :: myCaf(:)[:] allocate(myCaf(1)[*]) call doubtful_valid(myCaf) ! { dg-warning "to allocatable, noncoarray dummy" } call invalid(myCaf) ! { dg-error "to allocatable, noncoarray, INTENT.OUT. dummy" } contains subroutine doubtful_valid(x) integer, allocatable :: x(:) ! Valid as x's allocation status is not touched. x(1) = 7 end subroutine doubtful_valid subroutine invalid(y) integer, allocatable, intent(out) :: y(:) allocate (y(1)) end subroutine invalid end