nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_24.f90
blobd8d92816d26ec51f732b8b61594d0d037c7d9257
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=single -Wall" }
4 ! This program is perfectly valid; however, passing an (allocatable) coarray
5 ! as actual argument to a non-coarray allocatable dummy is doubtful as
6 ! reallocation is not allowed. Thus, an intent(out) dummy should be always
7 ! wrong.
10 integer, allocatable :: myCaf(:)[:]
12 allocate(myCaf(1)[*])
14 call doubtful_valid(myCaf) ! { dg-warning "to allocatable, noncoarray dummy" }
15 call invalid(myCaf) ! { dg-error "to allocatable, noncoarray, INTENT.OUT. dummy" }
16 contains
17 subroutine doubtful_valid(x)
18 integer, allocatable :: x(:)
19 ! Valid as x's allocation status is not touched.
20 x(1) = 7
21 end subroutine doubtful_valid
22 subroutine invalid(y)
23 integer, allocatable, intent(out) :: y(:)
24 allocate (y(1))
25 end subroutine invalid
26 end